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)
in Go-1, we have:
The
Anonymousfield is a bit ambiguous or at least misleading.For Go-2, rename it as
Embedded.(see: https://golang.org/cl/35732/ for context)