You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool/nstruct/check.go

15 lines
288 B
Go

1 year ago
package nstruct
// IsExported field name on struct
func IsExported(name string) bool {
return name[0] >= 'A' && name[0] <= 'Z'
}
// IsUnexported field name on struct
func IsUnexported(name string) bool {
if name[0] == '_' {
return true
}
return name[0] >= 'a' && name[0] <= 'z'
}