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

encoding/json, encoding/xml: update documentation to use embedded fields instead of anonymous fields. #27031

Open
hundt opened this Issue Aug 16, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@hundt

hundt commented Aug 16, 2018

This is a documentation issue.

The json.Marshal documentation refers to "anonymous struct fields," which the spec has been calling "embedded" struct fields since f8b4123. This is confusing to readers who want to know how embedded struct fields are marshaled and aren't aware of the historic terminology.

Searching the codebase for "anonymous struct" suggests that the encoding/xml godoc has the same issue.

@agnivade agnivade changed the title from godoc: json.Marshal documentation uses outdated "anonymous struct fields" to encoding/json, encoding/xml: update documentation to use embedded fields instead of anonymous fields. Aug 16, 2018

@moficodes

This comment has been minimized.

moficodes commented Aug 18, 2018

I can make this commit and pull request.
Could someone assign me this issue?
@agnivade

Thanks.

moficodes added a commit to moficodes/go that referenced this issue Aug 18, 2018

encoding/json, encoding/xml: update doc to use "embedded struct"
Json marshal documentation refers to "anonymous struct fields" which has been renamed to "embedded struct fields"

changed doc to reflect that change

Changes to be committed:
	modified:   src/encoding/json/encode.go
	modified:   src/encoding/xml/marshal.go
	modified:   src/encoding/xml/read.go

Fixes golang#27031
@gopherbot

This comment has been minimized.

gopherbot commented Aug 18, 2018

Change https://golang.org/cl/129815 mentions this issue: encoding/json, encoding/xml: update doc to use "embedded struct" instead of "anonymous struct"

@gopherbot

This comment has been minimized.

gopherbot commented Aug 18, 2018

Change https://golang.org/cl/129756 mentions this issue: encoding/json, encoding/xml: updated the documentation to use embedded fields instead of anonymous fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment