Empty interface
suggest changeType interface{}
is called an empty interface.
By definition it’s an interface with no methods defined.
That means that every type conforms to an empty interface.
In Go interface{}
is used as a dynamic type.
It’s similar to an object in C# or Java because it combines a type and a value into a single value.
Empty interface is also how you implement a union type in Go.
Zero value of empty interface is nil.
Learn more about empty interfaces.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents