Open
Description
Is your feature request related to a problem? Please describe.
I wrote that code, and I did not understand why path
was empty, although findDev()
returns a non-empty path:
func getDeviceFromPath(path string) (*evdev.InputDevice, error) {
if path == "" {
path, err := findDev() // "path" of outer block gets overwritten
if err != nil {
return nil, err
}
fmt.Printf("Using device %q\n", path)
}
sourceDev, err := evdev.Open(path)
Describe the solution you'd like
I would like to see a warning in vscode, when I overwrite a variable from the outer scope.
Describe alternatives you've considered
I could use external linters, but I think that should be available "out of the box".