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

Comments

Projects
None yet
4 participants
@sbinet
Copy link
Member

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 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

@gopherbot gopherbot added the Proposal label Jun 17, 2017

@ianlancetaylor ianlancetaylor added Go2Cleanup 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
You can’t perform that action at this time.