reflect: StructOf allows fields with inconsistent export information #45277
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The
StructField.PkgPath
field should only be populated if the field is unexported. Currently in Go, this can only occur if the first character is an uppercase letter. Thus, an exportedName
should not be allowed withPkgPath
also being specified. However, this is currently permitted:I expect the snippet above to panic.
The text was updated successfully, but these errors were encountered: