import "testing" func TestMyFunction(t *testing.T) { expected := "hello" actual := myFunction() if actual != expected { t.Fatalf("Expected %s but got %s", expected, actual) } }In this example, if the actual value returned by myFunction() is not equal to the expected value, the test will fail and the message passed to Fatal() will be logged. The package library used in this example is the standard Go testing package.