Merge lp:~rogpeppe/goyaml/goyaml-omit-zero-pointers into lp:~gophers/goyaml/trunk
Proposed by
Roger Peppe
Status: | Merged |
---|---|
Merged at revision: | 30 |
Proposed branch: | lp:~rogpeppe/goyaml/goyaml-omit-zero-pointers |
Merge into: | lp:~gophers/goyaml/trunk |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~rogpeppe/goyaml/goyaml-omit-zero-pointers |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+83603@code.launchpad.net |
Description of the change
goyaml: omit zero-value pointers
The documentation does not explicitly mention pointers
when marshalling, but it seems within the spirit of the
documentation that nil pointers should not be marshalled
when the omitzero tag is set.
This enables struct values to be omitted from the output if desired.
To post a comment you must log in.
Nice, LGTM
https:/ /codereview. appspot. com/5431087/ diff/1/ goyaml. go
File goyaml.go (right):
https:/ /codereview. appspot. com/5431087/ diff/1/ goyaml. go#newcode266
goyaml.go:266: return v.IsNil()
You can join this to the above Interface case:
case reflect.Ptr, reflect.Interface:
...
https:/ /codereview. appspot. com/5431087/