Is there a way to "down cast" a custom primitive type back to its original primitive? For example casting type AwesomeType byte
to byte
for use by a Writer
?
You can simply cast with the type you want:
var a AwesomeType; b := byte(a)
Example: http://play.golang.org/p/-Sj7zmz6zt