x/tools/go/analysis/passes/shadow: "go vet --shadow" doesn't check global variable shadowing #35731
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not tested with latest 1.13
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
package main
import (
"fmt"
)
var testStr string
func main() {
if testStr != "" {
fmt.Println("Not empty")
}
testStr := "Test string"
fmt.Println(testStr)
}
What did you expect to see?
After executing the following command, I would expect to throw error related to shadowing
$ go vet -vettool=$(which shadow)
$
What did you see instead?
Nothing was printed as output
The text was updated successfully, but these errors were encountered: