akash-network / support

Akash Support and Issue Tracking
Apache License 2.0
5 stars 4 forks source link

lint: prohibid shadowed variables #71

Open troian opened 4 years ago

boz commented 4 years ago

Is there a linter for this in golangci-lint or elsewhere?

I'd have to see some examples of issues from shadowing; I tend to prefer shadowing over using contrived names.

troian commented 4 years ago

govet is for linter to detect such things

troian commented 4 years ago

One of cases when shadow may cause issues

func Foo() (n int, err error) {
    if true {
        err := fmt.Errorf("Invalid")
        return
    }
    return
}
boz commented 4 years ago

ah, cool. we're already running go vet here