- Create a file typing test codes;
hello_test.go
package main
import (
"testing"
)
func TestGetHello(t *testing.T) {
expected := "Hello world!"
result := getHello()
if expected != result {
t.Errorf("Test fail expected: %s, result: %s\n", expected, result)
}
}