directory
0.0.0-20240710092454-d40bdaea4b58
Repository: https://github.com/kdlug/go.git
Documentation: pkg.go.dev
# Packages
An interface type consists of a set of method signatures.
An interface value consists of a concrete value and a dynamic type: [Value, Type] The zero value of an interface type is nil, which is represented as [nil, nil].
Equality Two interface values are equal - if they have equal concrete values and identical dynamic types, - or if both are nil.
We don't have to use structs to implement interfaces We can use any type of custom type.
A type assertion provides access to an interface’s concrete value A type assertion doesn’t really convert an interface to another data type, but it provides access to an interface’s concrete value, which is typically what you want.
interface{} means any type we can change our behaviour depends on type A type switch performs several type assertions in series and runs the first case with a matching type.
No description provided by the author