You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The go vet docs state: "Its exit code is 2 for erroneous invocation of the tool, 1
if a problem was reported, and 0 otherwise." However, the command only ever returns
0 or 2. I tested both with go1.2 and go version devel +9963a911bc14 Thu Dec 26 13:03:30
2013 -0800 darwin/amd64. See the commands below.
Result:
* Exit code success: 0
* Exit code after warning: 0 (SHOULD BE 1)
* Exit code with bad flags: 2
example.go:
package main
import (
"fmt"
"go/ast"
)
func main() {
c := ast.Comment{0, "text"}
fmt.Println("c: ", c)
}
Commands:
Yoho:~ ej$ go version
go version go1.2 darwin/amd64
Yoho:~ ej$ go vet example.go; echo "CODE: $?"
example.go:9: go/ast.Comment composite literal uses unkeyed fields
CODE: 0
Yoho:~ ej$ go vet -bad example.go &> /dev/null; echo "CODE: $?"
CODE: 2
Yoho:~ ej$ go tool vet example.go; echo "CODE: $?"
example.go:9: go/ast.Comment composite literal uses unkeyed fields
CODE: 0
Yoho:~ ej$ /usr/local/go/pkg/tool/darwin_amd64/vet example.go; echo "CODE: $?"
example.go:9: go/ast.Comment composite literal uses unkeyed fields
CODE: 0
The text was updated successfully, but these errors were encountered:
by ej@evanjones.ca:
The text was updated successfully, but these errors were encountered: