mirror of
https://github.com/golang/go
synced 2024-11-14 07:20:22 -07:00
538b3a5f37
According to the language spec, a struct field name should be an identifier. identifier = letter { letter | unicode_digit } . letter = unicode_letter | "_" . Implements a function 'isValidFieldName(fieldName string) bool'. To check if the field name is a valid identifier or not. It will panic if the field name is invalid. It uses the non-exported function implementation 'isLetter' from the package 'scanner', used to parse an identifier. Fixes #20600. Change-Id: I1db7db1ad88cab5dbea6565be15cc7461cc56c44 Reviewed-on: https://go-review.googlesource.com/45590 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
---|---|---|
.. | ||
all_test.go | ||
asm_386.s | ||
asm_amd64.s | ||
asm_amd64p32.s | ||
asm_arm64.s | ||
asm_arm.s | ||
asm_mips64x.s | ||
asm_mipsx.s | ||
asm_ppc64x.s | ||
asm_s390x.s | ||
deepequal.go | ||
example_test.go | ||
export_test.go | ||
makefunc.go | ||
set_test.go | ||
swapper.go | ||
tostring_test.go | ||
type.go | ||
value.go |