radondb-mysql-kubernetes icon indicating copy to clipboard operation
radondb-mysql-kubernetes copied to clipboard

[feature] Add check for shadowed variables.

Open runkecheng opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

go tool vet -shadow=true ./

ref: https://github.com/barakmich/go-nyet

Add check in ci.

Describe alternatives you've considered

Additional context

runkecheng avatar Apr 26 '22 02:04 runkecheng

go nyet may be misjudgment, so it can only be used as a self -examination and cannot be used as a standard.

runkecheng avatar Apr 26 '22 06:04 runkecheng

go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet -vettool=$(which shadow)

acekingke avatar Apr 26 '22 06:04 acekingke