Skip to content

x/tools/shadow: shadowing predefined identifiers is not detected? #56871

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

Closed
leovct opened this issue Nov 21, 2022 · 1 comment
Closed

x/tools/shadow: shadowing predefined identifiers is not detected? #56871

leovct opened this issue Nov 21, 2022 · 1 comment
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@leovct
Copy link

leovct commented Nov 21, 2022

Hi, I'm currently reading the Learning Go book and I came across the Shadowing variables section where it's mentioned that the go tool shadow does not catch shadowing predefined identifiers. I wanted to know why it was not implemented and if that's something planned, how can I help :slight_smile:

Here's a simple example

package main

import "fmt"

func main() {
    fmt.Println(true)
    true := "hey"
    fmt.Println(true)
}
$ go run main.go
true
hey // "true" identifier shadowed!

$ shadow main.go
// no errors detected :(
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Nov 21, 2022
@gopherbot gopherbot added this to the Unreleased milestone Nov 21, 2022
@leovct leovct changed the title x/tools/shadow: x/tools/shadow: shadowing predefined identifiers is not detected? Nov 21, 2022
@seankhliao
Copy link
Member

Duplicate of #33567

@seankhliao seankhliao marked this as a duplicate of #33567 Nov 21, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2022
@golang golang locked and limited conversation to collaborators Nov 21, 2023
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