x/tools/go/analysis/cmd/vet: also whitelist unicode.Range32 to avoid "unkeyed fields in composite literal" error #32507
Labels
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. 1.12.5 is the latest release available for macOS on golang.org/dl/.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I used struct literals without keys.
go vet
doesn't complain when it seesunicode.Range16{0xfdd0, 0xfdef, 1}
, but complains when it seesunicode.Range32{0x1fffe, 0x1ffff, 1}
.Minimized test case: https://play.golang.org/p/atnHOc10YRs
Semi-minimized real-world example: https://play.golang.org/p/VzaW9okIUic
What did you expect to see?
No
go vet
errors. Or, now that I've researched a bit into howgo vet
should work, errors for usingunicode.Range16
like this, too.What did you see instead?
go vet
errors on lines likeunicode.Range32{0x1fffe, 0x1ffff, 1}
. After seeing the discussion on #6820 I'm not sure whyunicode.Range16
is fine butunicode.Range32
is warning-worthy.The text was updated successfully, but these errors were encountered: