3 ms·
Not sure it would help you but adding "go vet -shadow" to some kind of test or build script may help you detect these problems. https://golang.org/cmd/vet/ htt
by kyrra 10y ago
Not sure it would help you but adding "go vet -shadow" to some kind of test or build script may help you detect these problems.
https://golang.org/cmd/vet/ https://golang.org/cmd/vet/
- leetrout 10y agoThis. If anyone is using VIM or Atom please please please install the Go helpers, too. Atom's go-plus is awesome. The team I work with- I beg them to use linters and go-plus and avoid these pitfalls like shadowing err. Instead most of them will run the linter, not fix the errors, then defend poor practices like shadowing and returning private types from exported methods.