-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
MapSlice does not support anchors/merges #184
Comments
@niemeyer if we send a patch for this what is the process for getting it merged? Is the v2 branch frozen or are you accepting changes? If not, is there a timeline for v3? cc @donny-dont |
@bradrydzewski could you please try with #220 |
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
@bradrydzewski @Mange Its fixed by #220 I took the liberty to add the above test cases to the tests |
Thank you! |
@vinzenz yep, that did the trick. I'm vendoring your patch at the moment, but hopefully the pull request can get merged in the near future. Thanks! |
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
Signed-off-by: Vinzenz Feenstra <evilissmo@redhat.com>
Sorry for the lack of feedback here. I can't just merge the PR fixing this as there are a number of unrelated changes in it. That said, MapSlice is about to die. yaml.v3 is on the way and a more comprehensive way to decode content partially and preserve style will be introduced. I'll keep this issue open and close it when it's ready. |
Thanks for the update @niemeyer. Given lots of us are likely to be on v2 for some time, would you still be amenable to accepting a patch for this specific issue in v2? |
Thank you @niemeyer. I am also watching this one. |
I'd like to put a tombstone on this issue. MapSlice will die in v3, and be replaced by a much more flexible intermediate representation. I want to focus on that instead, and anyone that really wants such MapSlices and merges, which is not quite common, can move forward and migrate into it. v3 is on the way and coming soon. |
Damned, still no support of anchor in yo-yaml? Still is it a pretty standard way of using yaml ... when is v3 expected? |
We maintain a fork that we use for Buildkite at https://github.com/buildkite/yaml that includes the patches for anchors with MapSlice @gsemet |
for anyone tired of waiting - these tools give correct output: |
* v/fix-for-issue-91: (40 commits) Add test cases from go-yaml#184 Fix for issue go-yaml#91 Fixes go-yaml#214 - New option to allow setting strict boolean mode Fix for issue go-yaml#144 Always use the pointer mechanism, but only allow recursion per option Applied API changes as suggested in another PR and fixed outstanding problems Removed introduced shadowing bug Make aliases share the same memory address as the anchor ( go-yaml#215 ) Replace LICENSE text with actual license (go-yaml#274) Make tag scanning code slightly cleaner. move embedded struct example into godoc Add UnmarshalStrict returning error if yaml has fields that do not exist in structure correct misspell on yamlh.go fix misspell on emmiterc.go Remove unreachable code to fix go vet (go-yaml#249) Fix dead URL for yaml specification (go-yaml#240) Tighten restrictions on float decoding (go-yaml#171) Fix decode test for Go 1.8 (go-yaml#217) Fix unmarshaler handling of empty strings. new license in the README file (go-yaml#189) ...
Hi! I seem to have found a bug in
MapSlice
:Output:
Note how the test with the normal
map[string]interface{}
works properly. I'm still a beginner in Go, so I'm not sure where to start to fix this one. I have a really hard time understanding the decoding code, but a small pointer in the right direction might help me find some way of fixing this.The text was updated successfully, but these errors were encountered: