func TestAddition(t *testing.T) { sum := 2 + 2 if sum != 4 { t.Error("Expected 2 + 2 to equal 4") } } func TestDivision(t *testing.T) { _, err := divide(10, 0) if err == nil { t.Error("Expected division by zero error") } } func divide(a, b int) (int, error) { if b == 0 { return 0, fmt.Errorf("cannot divide by zero") } return a / b, nil }In the first example, we check that the result of adding 2 + 2 is equal to 4, and report an error if the condition is not met. In the second example, we test a function that performs integer division and returns an error if the denominator is zero. We use `T.Error` to report an error if the function doesn't return an error when the denominator is zero. The `T` type and related functions are part of the `testing` package in the standard Go library.