In this lecture, we look at how in Go the method set (
method set) depends on the receiver and why an interface can accept
*
T, but not
T. Using the
TaskStore interface and the
MemStore implementation, we will see the typical error “
Add has pointer receiver”, understand the difference between a convenient method call and an interface implementation check, and also learn how to diagnose the dynamic type via
fmt.Printf(
"%T", x) and avoid the typed nil trap in interfaces such as
error.