I am learning the go basic grammar. The document says "go doesn’t support the Automatic Type Conversion or Implicit Type Conversion ". I wrote some code to test it.
package main
import (
"fmt"
)
type myfloat float32
type myfunc func(string)
func bbb(a myfloat) {
fmt.Printf("bbb %T\n", a)
}
func ccc(m myfunc) {
fmt.Printf("ccc %T\n", m)
}
func main() {
i := float32(1.1)
bbb(i) //can't build
d := func(s string) {}
ccc(d)
}
bbb(i) can't build successfully, this is due to the type is different. My question is why ccc(d) can pass build? myfunc is also a user defined type, which is similar like the myfloat.