The first question people probably have is What is an interface value? To that I say Dang, I was hoping you would tell me!. Jokes aside, please consider the following (Golang playground):
var x int64
var y interface{}
x = 2
y = x
What happens when y
is assigned the value of x
? This is known as storing a value in an interface, or just an interface value.
But how do we use a value once it is stored in an interface? Keep reading to find out!
Next: Using an interface value