cmd/vet: unnecessary diagnostics about json:"-" on unexported fields #43196
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?What did you do?
I like to write code such as the following:
The unexported fields have a
json:"-"
tag, so that the resulting behaviour doesn't change if I happen to export the fields later. Unfortunately, this causesgo vet
warning:There is apparently no way to disable this warning without disabling all JSON-related checks. Please disable the warning in the particular case of a
json:"-"
tag, or at least provide a way to disable it without disabling all JSON-related checks.What did you expect to see?
go vet
doesn't warn aboutjson:"-"
tags on unexported fields, only about non-trivial json tags.What did you see instead?
go vet
complains, and there is no way to avoid the warning short of disabling all JSON-related checking.The text was updated successfully, but these errors were encountered: