Skip to content

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

Closed as not planned
@leovct

Description

@leovct

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 :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions