Conversion, Not Casting



Conversion means we take the value of one type and convert it to another type.

Let's try it out in the Go playground

package main



import (

"fmt"

)



var a int

type hotdog int

var b hotdog



func main() {

a = 42

b = hotdog(a) // we can...



Read: https://blog.cloudnativefolks.org/conversion-not-casting