gounit is test assertions library for Go. It was developed to address the shortcoming of many assertion frameworks that employ assertion of types at runtime rather than compile time.
// direct assertion style
func Test_nine_plus_two_is_greater_than_ten(t *testing.T) {
actual := 9 + 2
expected := 10
gunit.Number(t, actual).GreaterThan(expected)
}
// wrap testing.T struct
func Test_nine_plus_two_is_greater_than_ten(t *testing.T) {
assert := gunit.New(t)
actual := 9 + 2
expected := 10
assert.Int(actual).GreaterThan(expected)
}