Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 610 Bytes

01-storing-an-interface-value.md

File metadata and controls

18 lines (12 loc) · 610 Bytes

Storing an interface value

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