We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
For the following example:
package main import ( "encoding/json" "io/ioutil" "log" "os" ) func main() { if len(os.Args) != 2 { log.Fatal("Usage: jsonformat.go <filename>") } byt, err := ioutil.ReadFile(os.Args[1]) if err != nil { log.Fatalf("ERROR: Unable to read file %q: %v\n", os.Args[1], err) } var dat map[string]interface{} if err := json.Unmarshal(byt, &dat); err != nil { // this err is not flagged as masking the err in the outer scope, incorrectly log.Fatalf("ERROR: Invalid JSON file '%v': %v\n", os.Args[1], err) } if output, err := json.MarshalIndent(dat, "", " "); err != nil { // this err is flagged as masking the err in the outer scope, correctly log.Fatalf("ERROR: Unable to indent JSON file: %v\n", os.Args[1]) } else { os.Stdout.Write(append(output, '\n')) } }
One the errors is not flagged correctly, even when using -shadowstrict. My version of go tool vet is at 108746816ddf01ad0c2dbea08a1baef08bc47313
-shadowstrict
go tool vet
108746816ddf01ad0c2dbea08a1baef08bc47313
The text was updated successfully, but these errors were encountered:
Original discussion: https://groups.google.com/forum/#!topic/golang-nuts/uD0wsdeQ-xs
Sorry, something went wrong.
This is fixed in Go 1.6, though I do not know what fixed it.
I updated my version of go vet with a go get -u golang.org/x/tool/cmd/vet today... Should that not have picked up this change?
go vet
go get -u golang.org/x/tool/cmd/vet
I believe this was fixed by 3c1712d
@stevekuznetsov, vet is part of Go tool set since Go 1.5. golang.org/x/tool/cmd/vet is no longer maintained.
I think golang.org/x/tool/cmd/vet should be deleted at some point as it creates a lot of confusion.
No branches or pull requests
For the following example:
One the errors is not flagged correctly, even when using
-shadowstrict
. My version ofgo tool vet
is at108746816ddf01ad0c2dbea08a1baef08bc47313
The text was updated successfully, but these errors were encountered: