You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal: go vet should warn when initialising a value is unnecessary, i.e. when the zero value for the type is effectively equal to the explicitly initialised value
As someone new to the language, I have not memorised which types have a zero value and what those zero values are
I will look these up now that I know about them, but go vet could help me and others in this case
What did you see instead?
go vet does not indicate any issues about unnecessary initialisation
The text was updated successfully, but these errors were encountered:
Vet's tools are about correctness, not style. A vet check must identify real or
potential bugs that could cause incorrect compilation or execution. A check that
only identifies stylistic points or alternative correct approaches to a situation
is not acceptable.
I agree that unnecessary initialisation is not a bug
I've filed this as a suggestion for golint instead: golang/lint#317
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
What did you expect to see?
Proposal:
go vet
should warn when initialising a value is unnecessary, i.e. when the zero value for the type is effectively equal to the explicitly initialised valueAs someone new to the language, I have not memorised which types have a zero value and what those zero values are
I will look these up now that I know about them, but
go vet
could help me and others in this caseWhat did you see instead?
go vet
does not indicate any issues about unnecessary initialisationThe text was updated successfully, but these errors were encountered: