Skip to content
Quiz · From a file to a project · lesson 6 of 10

Quiz — Errorf and Fatalf

How many error lines does go test -v print for TestSum?

GO
func TestSum(t *testing.T) {
    got := 2 + 2
    if got != 5 {
        t.Fatalf("got %d, want 5", got)
    }
    if got%2 == 0 {
        t.Errorf("got %d is even", got)
    }
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way