We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Comments do not seem to be extracted from Flow-style YAMLs using yaml.CommentToMap.
yaml.CommentToMap
To Reproduce
From the example below, only "# comment2" can be extracted using yaml.CommentToMap, while all other comments appear to be ignored.
func TestComment(t *testing.T) { var input = []byte(` key1: [] # comment1 key2: [ # comment2 elm1, # comment3 elm2, # comment4 ] # comment5 key3: {} # comment6 key4: { # comment7 key1: value1, # comment8 key2: value2, # comment9 } # comment10 `) var f map[string]interface{} cm := yaml.CommentMap{} var err error if err = yaml.UnmarshalWithOptions(input, &f, yaml.CommentToMap(cm)); err != nil { panic(err) } for k, comments := range cm { fmt.Println("key: " + k) for _, comment := range comments { fmt.Println(comment.Texts) } } }
Version Variables
Additional context #419 seems to be related to this issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Comments do not seem to be extracted from Flow-style YAMLs using
yaml.CommentToMap
.To Reproduce
From the example below, only "# comment2" can be extracted using
yaml.CommentToMap
, while all other comments appear to be ignored.Version Variables
Additional context
#419 seems to be related to this issue.
The text was updated successfully, but these errors were encountered: