A type implements a Go interface by providing its methods. There is no declaration that registers the relationship. This works well when a consumer asks for one small behavior, such as a name or a cost, instead of depending on a large concrete type. An interface value holds a dynamic type and a dynamic value. A typed nil pointer stored inside an interface is therefore different from a nil interface. Avoid using a nil comparison as a universal test of whether every concrete object is usable. In this lesson you will compose behaviors, use type assertions with their success flag and keep fallbacks explicit. The examples stay local, but the same boundary lets a service use a small fake dependency during a test.
Call the interface method on each value.