Playground: https://play.golang.org/p/2j2PlKwiA7B

Source code:

package main
   
import (
 "fmt"
)
   
func main() {
 fmt.Printf("%x\n", 5.0/7.0)
}


Expected: No message emits by go vet


Actual: go vet emits the following message:

./prog.go:8:2: Printf format %x has arg 5.0 / 7.0 of wrong type float64 


According to https://golang.org/pkg/fmt/ , %x with floating point displays 
hexadecimal notation (with decimal power of two exponent), which is legal 
usage. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/828b1b12-dc91-46ba-a12c-ca19fde3abfc%40googlegroups.com.

Reply via email to