golang/go

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

Open

#27.031 aperta il 16 ago 2018

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsFixhelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

This is a documentation issue.

The json.Marshal documentation refers to "anonymous struct fields," which the spec has been calling "embedded" struct fields since f8b4123613a2cb0c453726033a03a1968205ccae. 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.

Guida contributor