Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/analysis/passes/shadow: fails to detect shadowed result identifiers #44875

Closed
mdevan opened this issue Mar 9, 2021 · 1 comment
Closed
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mdevan
Copy link

mdevan commented Mar 9, 2021

What version of Go are you using (go version)?

$ go version
go version go1.15.7 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

$ cat a.go
package main

import "os"

func foo() (err error) {
        x, err := os.Getwd()
        _ = x
        return
}
$ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
$ go vet -vettool=$(which shadow) a.go
$

What did you expect to see?

Warning about err being shadowed.

What did you see instead?

Nothing.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Mar 9, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 9, 2021
@seankhliao
Copy link
Member

The variable is redeclared not shadowed

closing as not a bug

@golang golang locked and limited conversation to collaborators Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants