Let me expand tumor detection for better clarity.
I will go from call to call to show how we enter the loop.
We start with the exercise.
func (e NegativeSqrt) Error() string { fmt.Printf(".") return fmt.Sprint(e) }
Which brings us to line 237 fmt / print.go :
func Sprint(a ...interface{}) string
Inside the function, our next jump is on line 239:
p.doPrint(a, false, false)
We come to line 1261:
func (p *pp) doPrint(a []interface{}, addspace, addnewline bool) {
Inside this function, we will jump with our error argument on line 1273:
prevString = p.printArg(arg, 'v', 0)
We come to the huge kernel monster function on line 738:
func (p *pp) printArg(arg interface{}, verb rune, depth int) (wasString bool) {
Inside this you can see a large switch case . error goes to the default section, as it is considered a non-trivial type.
Which brings us to line 806 with the handleMethods() call:
if handled := p.handleMethods(verb, depth); handled {
We come to line 688:
func (p *pp) handleMethods(verb rune, depth int) (handled bool) {
Inside this function, on line 724, the Error() call is made, which completes the loop:
p.printArg(v.Error(), verb, depth)