Skip to content
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

proposal: reflect: rename StructField.Anonymous to Embedded #18786

Open
sbinet opened this issue Jan 25, 2017 · 0 comments
Open

proposal: reflect: rename StructField.Anonymous to Embedded #18786

sbinet opened this issue Jan 25, 2017 · 0 comments
Labels
Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. Proposal v2 A language change or incompatible library change
Milestone

Comments

@sbinet
Copy link
Member

sbinet commented Jan 25, 2017

in Go-1, we have:

$> go doc reflect StructField 
type StructField struct {
	// Name is the field name.
	Name string
	// PkgPath is the package path that qualifies a lower case (unexported)
	// field name. It is empty for upper case (exported) field names.
	// See https://golang.org/ref/spec#Uniqueness_of_identifiers
	PkgPath string

	Type      Type      // field type
	Tag       StructTag // field tag string
	Offset    uintptr   // offset within struct, in bytes
	Index     []int     // index sequence for Type.FieldByIndex
	Anonymous bool      // is an embedded field
}
    A StructField describes a single field in a struct.

The Anonymous field is a bit ambiguous or at least misleading.

For Go-2, rename it as Embedded.

(see: https://golang.org/cl/35732/ for context)

@bradfitz bradfitz added v2 A language change or incompatible library change Thinking labels Jan 25, 2017
@bradfitz bradfitz modified the milestone: Unplanned Mar 21, 2017
@rsc rsc changed the title reflect: rename StructField.Anonymous into Embedded reflect: rename StructField.Anonymous to Embedded Jun 16, 2017
@rsc rsc changed the title reflect: rename StructField.Anonymous to Embedded proposal: reflect: rename StructField.Anonymous to Embedded Jun 17, 2017
@ianlancetaylor ianlancetaylor added Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. and removed Thinking labels Jan 23, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Unplanned, Proposal Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. Proposal v2 A language change or incompatible library change
Projects
None yet
Development

No branches or pull requests

4 participants