Golang doesn’t allow casting of untyped value, and a literal
4.4 is a float and it knows this, but you haven’t said which kind of float (
float32)? Type inference works only if you declare a variable which has this value:
x := 4.4 var z int = int(x)
It’s pragmatic and right!