Here is small code snippet that workds well:
package main
import "fmt"
import "database/sql"
type Something struct {
Int64 int64
Valid bool
}
func main() {
var s = sql.NullInt64{1, true} // <- unkeyed fields warning
var s1 = Something{1, true}
fmt.Printf("Hello, %#v %#v\n", s, s1)
}
But go vet complains:
test.go:12: database/sql.NullInt64 composite literal uses unkeyed fields
Question is: why it does complain on line 12 and does not complain on line 13 here ?