Let’s say you have the following
type Person interface {
GetFullName() string
PrintName()
}
type Banker struct {
FirstName string
LastName string
}
func (b Banker) GetFullName() string {
return fmt.Sprintf("%s %s", b.FirstName, b.LastName)
}
func (b Banker) PrintName() {
return log.Println(b.GetFullName())
}
How do you mock GetFullName from PrintName?
Note, this is just an example to make the problem easier to understand