// test.go
package main
import "fmt"
func main() {
fmt.Printf("%s", 0) // format error
}
With go build test.go
I got no warning messages or errors at all. I don't see a warning flag in go help build
either. Am I missing something?
test.go
:
package main
import "fmt"
func main() {
fmt.Printf("%s
", 0) // format error
}
For example,
Output:
$ go build test.go
$ ./test
%!s(int=0)
$
For help, run go help build
.
Or,
Output:
$ go run test.go
%!s(int=0)
$
For help, run go help run
.
Or,
Output:
$ go vet test.go
# command-line-arguments
./test.go:7:2: Printf format %s has arg 0 of wrong type int
$
For help, run go help vet
.
Reference Command go