-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge
Milestone
Description
The type reflect.StructField has a field called "Anonymous". But frankly there
are no anonymous fields in Go, at least they are not what "reflect" thinks
they are. Reflect package puts "true" into that field on embedded fields,
which are not anonymous, because their name matches their type name. And real anonymous
fields:
type X struct {
_ io.Reader
_ io.Reader
}
are not marked as such. And that makes that particular case a source of terminology
confusion.
P.S. As a somewhat related note, it would be nice to be able to distinguish between a
user-defined method (that is written explicitly in the source code) and a automatically
generated method which was inherited from an embedded field. Should I create a separate
issue on that?Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge