Golang type conversions
16 August 2024 (Updated 18 May 2025)
The expression T(v) converts the value v to the type T.
Some numeric conversions:
var i int = 42
var f float64 = float64(i)
var u uint = uint(f)
Tagged:
Golang