I thought go didn't allow any named type to actual type assignment without explicit type conversion.
But how does it compile without an error if I assign []byte
to json.RawMessage
?
var a json.RawMessage // type RawMessage []byte
var b []byte
a = b
var x time.Duration // type Duration int64
var y int64
x = y // ERROR: cannot use y (type int64) as type time.Duration in assignment