In this section, you will learn how to write tests for an existing Go application that includes two functions: one for calculating numbers of the Fibonacci sequence and one for finding out the length of a string. The main reason for using these two functions that implement such relatively trivial tasks is simplicity. The tricky point here is that each function will have two different implementations: one that works well and another one that has some issues.
The Go package in this example is named testMe and it is saved as testMe.go. The code of this package will be presented in three parts.
The first part of testMe.go includes the following Go code:
package testMe func f1(n int) int { if n == 0 { return ...