Skip to content

reflect: DeepEqual doc should refer to "elements", not "members" #4258

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

Closed
bcmills opened this issue Oct 18, 2012 · 2 comments
Closed

reflect: DeepEqual doc should refer to "elements", not "members" #4258

bcmills opened this issue Oct 18, 2012 · 2 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Oct 18, 2012

reflect.DeepEqual() empirically uses shallow equality for map keys but deep equality for
map values.  (http://play.golang.org/p/4zQk_WLqlg)  Although the behavior is reasonable,
a casual reader might be surprised by it.

The documentation for DeepEqual says that it "will scan members of arrays, slices,
maps, and fields of structs", but the language spec does not use the word
"members".  It would be clearer to use the (defined) term "elements"
instead so that the reader doesn't have to guess whether "members" is meant to
include "keys".
@robpike
Copy link
Contributor

robpike commented Oct 20, 2012

Comment 1:

Labels changed: added priority-later, documentation, removed priority-triage.

Owner changed to @robpike.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Oct 30, 2012

Comment 3:

This issue was closed by revision 8884fab.

Status changed to Fixed.

@bcmills bcmills added fixed Documentation Issues describing a change to documentation. labels Oct 30, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants