package main import ( "fmt" ) func main() { var a int = 42 // var b float64 = a // NG var b float64 = float64(a) // 明示的変換が必要 var c float64 = 42 // OK fmt.Println(b) fmt.Println(c) }
ExpressibleByXxx