assert is a Go library that helps you make assertions in tests, printing a human-readable report of the differences between two values in assertions that fail.
$ go get github.com/kkyr/assert@latest
package person_test
import (
"testing"
"github.com/kkyr/assert"
)
func TestPerson(t *testing.T) {
assert := assert.New(t)
want := []string{"John", "Jim"}
got := []string{"John", "Joe"}
assert.Field("Names").Equal(want, got)
// Output:
// --- FAIL: TestPerson (0.00s)
// person_test.go:15: Names: (-want, +got):
// []string{
// "John",
// - "Jim",
// + "Joe",
// }
}