diff --git a/assets/test/templates/common/function.tmpl b/assets/test/templates/common/function.tmpl index f852e71c05a..7b3acbe71ca 100644 --- a/assets/test/templates/common/function.tmpl +++ b/assets/test/templates/common/function.tmpl @@ -54,12 +54,12 @@ func {{ .TestName }}(t *testing.T) { {{- if .ReturnsError }} if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } {{- end }} {{- range .TestResults }} {{ $want := Want . }} {{ $got := Got . }} if !reflect.DeepEqual({{ $got }}, w.{{ $want }}) { - return errors.Errorf("got = %v, want %v", {{ $got }}, w.{{ $want }}) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", {{ $got }}, w.{{ $want }}) } {{- end }} return nil diff --git a/assets/test/templates/option/function.tmpl b/assets/test/templates/option/function.tmpl index ff4876f9347..bafab33ef6c 100644 --- a/assets/test/templates/option/function.tmpl +++ b/assets/test/templates/option/function.tmpl @@ -52,10 +52,10 @@ func {{ .TestName }}(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func {{ .TestName }}(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/hack/benchmark/core/benchmark/benchmark_test.go b/hack/benchmark/core/benchmark/benchmark_test.go index 72dc58bea3e..7e0d952bff3 100644 --- a/hack/benchmark/core/benchmark/benchmark_test.go +++ b/hack/benchmark/core/benchmark/benchmark_test.go @@ -44,7 +44,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Benchmark) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/option_test.go b/hack/benchmark/core/benchmark/option_test.go index daea019a902..335c932b2f0 100644 --- a/hack/benchmark/core/benchmark/option_test.go +++ b/hack/benchmark/core/benchmark/option_test.go @@ -48,10 +48,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -161,10 +161,10 @@ func TestWithStrategy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -174,7 +174,7 @@ func TestWithStrategy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit_test.go b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit_test.go index 4e4e5594b09..8794b8f8805 100644 --- a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit_test.go +++ b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit_test.go @@ -43,7 +43,7 @@ func TestNewBulkInsertCommit(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert_test.go b/hack/benchmark/core/benchmark/strategy/bulk_insert_test.go index d3a74c86dda..5461358c05a 100644 --- a/hack/benchmark/core/benchmark/strategy/bulk_insert_test.go +++ b/hack/benchmark/core/benchmark/strategy/bulk_insert_test.go @@ -42,7 +42,7 @@ func TestNewBulkInsert(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/get_vector_test.go b/hack/benchmark/core/benchmark/strategy/get_vector_test.go index ff1197e17a3..ff63eb1b87f 100644 --- a/hack/benchmark/core/benchmark/strategy/get_vector_test.go +++ b/hack/benchmark/core/benchmark/strategy/get_vector_test.go @@ -42,7 +42,7 @@ func TestNewGetVector(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/insert_commit_test.go b/hack/benchmark/core/benchmark/strategy/insert_commit_test.go index fb8ca37fc75..1e33f1ddfd5 100644 --- a/hack/benchmark/core/benchmark/strategy/insert_commit_test.go +++ b/hack/benchmark/core/benchmark/strategy/insert_commit_test.go @@ -43,7 +43,7 @@ func TestNewInsertCommit(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/insert_test.go b/hack/benchmark/core/benchmark/strategy/insert_test.go index bd0e0d803b9..7f745f04df4 100644 --- a/hack/benchmark/core/benchmark/strategy/insert_test.go +++ b/hack/benchmark/core/benchmark/strategy/insert_test.go @@ -42,7 +42,7 @@ func TestNewInsert(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/remove_test.go b/hack/benchmark/core/benchmark/strategy/remove_test.go index 0e533a25e17..ccb692ed699 100644 --- a/hack/benchmark/core/benchmark/strategy/remove_test.go +++ b/hack/benchmark/core/benchmark/strategy/remove_test.go @@ -42,7 +42,7 @@ func TestNewRemove(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/search_test.go b/hack/benchmark/core/benchmark/strategy/search_test.go index f48c55367b5..db4ea48753c 100644 --- a/hack/benchmark/core/benchmark/strategy/search_test.go +++ b/hack/benchmark/core/benchmark/strategy/search_test.go @@ -45,7 +45,7 @@ func TestNewSearch(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/strategy_option_test.go b/hack/benchmark/core/benchmark/strategy/strategy_option_test.go index 16e3e80f7b1..20ed456ea62 100644 --- a/hack/benchmark/core/benchmark/strategy/strategy_option_test.go +++ b/hack/benchmark/core/benchmark/strategy/strategy_option_test.go @@ -52,10 +52,10 @@ func TestWithPreProp32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithPreProp32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -165,10 +165,10 @@ func TestWithProp32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithProp32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -278,10 +278,10 @@ func TestWithPreProp64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -291,7 +291,7 @@ func TestWithPreProp64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -391,10 +391,10 @@ func TestWithProp64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithProp64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -504,10 +504,10 @@ func TestWithPropName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -517,7 +517,7 @@ func TestWithPropName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -617,10 +617,10 @@ func TestWithCore32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -630,7 +630,7 @@ func TestWithCore32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -730,10 +730,10 @@ func TestWithCore64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -743,7 +743,7 @@ func TestWithCore64(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -839,10 +839,10 @@ func TestWithParallel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -852,7 +852,7 @@ func TestWithParallel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/strategy_test.go b/hack/benchmark/core/benchmark/strategy/strategy_test.go index ea986e96b28..c03fb7012f8 100644 --- a/hack/benchmark/core/benchmark/strategy/strategy_test.go +++ b/hack/benchmark/core/benchmark/strategy/strategy_test.go @@ -47,7 +47,7 @@ func Test_newStrategy(t *testing.T) { } defaultCheckFunc := func(w want, got benchmark.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -135,7 +135,7 @@ func Test_strategy_Init(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -270,10 +270,10 @@ func Test_strategy_PreProp(t *testing.T) { } defaultCheckFunc := func(w want, got []uint, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/core/benchmark/strategy/util_test.go b/hack/benchmark/core/benchmark/strategy/util_test.go index fa868017d53..85ea982819b 100644 --- a/hack/benchmark/core/benchmark/strategy/util_test.go +++ b/hack/benchmark/core/benchmark/strategy/util_test.go @@ -46,7 +46,7 @@ func Test_wrapErrors(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -120,10 +120,10 @@ func Test_insertAndCreateIndex32(t *testing.T) { } defaultCheckFunc := func(w want, gotIds []uint, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIds, w.wantIds) { - return errors.Errorf("got = %v, want %v", gotIds, w.wantIds) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIds, w.wantIds) } return nil } @@ -201,10 +201,10 @@ func Test_insertAndCreateIndex64(t *testing.T) { } defaultCheckFunc := func(w want, gotIds []uint, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIds, w.wantIds) { - return errors.Errorf("got = %v, want %v", gotIds, w.wantIds) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIds, w.wantIds) } return nil } diff --git a/hack/benchmark/internal/assets/dataset_test.go b/hack/benchmark/internal/assets/dataset_test.go index 2f932ceb987..0dd5cdfd0bd 100644 --- a/hack/benchmark/internal/assets/dataset_test.go +++ b/hack/benchmark/internal/assets/dataset_test.go @@ -40,7 +40,7 @@ func TestData(t *testing.T) { } defaultCheckFunc := func(w want, got func(testing.TB) Dataset) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/client/ngtd/grpc/client_test.go b/hack/benchmark/internal/client/ngtd/grpc/client_test.go index 6d5c3c434f6..cae2a408053 100644 --- a/hack/benchmark/internal/client/ngtd/grpc/client_test.go +++ b/hack/benchmark/internal/client/ngtd/grpc/client_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -133,10 +133,10 @@ func Test_ngtdClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -232,10 +232,10 @@ func Test_ngtdClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -331,10 +331,10 @@ func Test_ngtdClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -430,7 +430,7 @@ func Test_ngtdClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -528,7 +528,7 @@ func Test_ngtdClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -625,7 +625,7 @@ func Test_ngtdClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -721,7 +721,7 @@ func Test_ngtdClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -818,7 +818,7 @@ func Test_ngtdClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -913,7 +913,7 @@ func Test_ngtdClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1009,7 +1009,7 @@ func Test_ngtdClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1106,7 +1106,7 @@ func Test_ngtdClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1201,7 +1201,7 @@ func Test_ngtdClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1297,7 +1297,7 @@ func Test_ngtdClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1394,7 +1394,7 @@ func Test_ngtdClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1490,10 +1490,10 @@ func Test_ngtdClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1589,7 +1589,7 @@ func Test_ngtdClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1686,7 +1686,7 @@ func Test_ngtdClient_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1780,7 +1780,7 @@ func Test_ngtdClient_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1873,7 +1873,7 @@ func Test_ngtdClient_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1968,10 +1968,10 @@ func Test_ngtdClient_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, got *client.InfoIndex, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2057,7 +2057,7 @@ func Test_searchRequestToNgtdSearchRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.SearchRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2128,7 +2128,7 @@ func Test_searchIDRequestToNgtdSearchRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.SearchRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2199,7 +2199,7 @@ func Test_ngtdSearchResponseToSearchResponse(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2270,7 +2270,7 @@ func Test_ngtdGetObjectResponseToObjectVector(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectVector) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2341,7 +2341,7 @@ func Test_objectVectorToNGTDInsertRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.InsertRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2412,7 +2412,7 @@ func Test_objectIDToNGTDRemoveRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.RemoveRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2483,7 +2483,7 @@ func Test_objectIDToNGTDGetObjectRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.GetObjectRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2554,7 +2554,7 @@ func Test_controlCreateIndexRequestToCreateIndexRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *proto.CreateIndexRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2626,10 +2626,10 @@ func Test_getSizeAndEpsilon(t *testing.T) { } defaultCheckFunc := func(w want, gotSize int32, gotEpsilon float32) error { if !reflect.DeepEqual(gotSize, w.wantSize) { - return errors.Errorf("got = %v, want %v", gotSize, w.wantSize) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotSize, w.wantSize) } if !reflect.DeepEqual(gotEpsilon, w.wantEpsilon) { - return errors.Errorf("got = %v, want %v", gotEpsilon, w.wantEpsilon) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotEpsilon, w.wantEpsilon) } return nil } @@ -2700,7 +2700,7 @@ func Test_tofloat64(t *testing.T) { } defaultCheckFunc := func(w want, gotOut []float64) error { if !reflect.DeepEqual(gotOut, w.wantOut) { - return errors.Errorf("got = %v, want %v", gotOut, w.wantOut) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOut, w.wantOut) } return nil } diff --git a/hack/benchmark/internal/client/ngtd/grpc/option_test.go b/hack/benchmark/internal/client/ngtd/grpc/option_test.go index fc93f129085..908720945a9 100644 --- a/hack/benchmark/internal/client/ngtd/grpc/option_test.go +++ b/hack/benchmark/internal/client/ngtd/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithGRPCClientOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithGRPCClientOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/client/ngtd/rest/client_test.go b/hack/benchmark/internal/client/ngtd/rest/client_test.go index 3dacda5561a..fbb43717cf2 100644 --- a/hack/benchmark/internal/client/ngtd/rest/client_test.go +++ b/hack/benchmark/internal/client/ngtd/rest/client_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -130,10 +130,10 @@ func Test_ngtdClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -221,10 +221,10 @@ func Test_ngtdClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -312,10 +312,10 @@ func Test_ngtdClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -403,7 +403,7 @@ func Test_ngtdClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -493,7 +493,7 @@ func Test_ngtdClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -582,7 +582,7 @@ func Test_ngtdClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -670,7 +670,7 @@ func Test_ngtdClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -759,7 +759,7 @@ func Test_ngtdClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -846,7 +846,7 @@ func Test_ngtdClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -934,7 +934,7 @@ func Test_ngtdClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1023,7 +1023,7 @@ func Test_ngtdClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1110,7 +1110,7 @@ func Test_ngtdClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1198,7 +1198,7 @@ func Test_ngtdClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1287,7 +1287,7 @@ func Test_ngtdClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1375,10 +1375,10 @@ func Test_ngtdClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1466,7 +1466,7 @@ func Test_ngtdClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1555,7 +1555,7 @@ func Test_ngtdClient_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1641,7 +1641,7 @@ func Test_ngtdClient_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1726,7 +1726,7 @@ func Test_ngtdClient_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1813,10 +1813,10 @@ func Test_ngtdClient_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, got *client.InfoIndex, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1896,7 +1896,7 @@ func Test_searchRequestToNgtdSearchRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *model.SearchRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1967,7 +1967,7 @@ func Test_searchIDRequestToNgtdSearchRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *model.SearchRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2038,7 +2038,7 @@ func Test_objectVectorToNgtdInsertRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *model.InsertRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2109,7 +2109,7 @@ func Test_objectVectorsToNgtdMultiInsertRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *model.MultiInsertRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2180,7 +2180,7 @@ func Test_objectIDsToNgtdMultiRemoveRequest(t *testing.T) { } defaultCheckFunc := func(w want, got *model.MultiRemoveRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2251,7 +2251,7 @@ func Test_ngtdSearchResponseToSearchResponse(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2323,10 +2323,10 @@ func Test_getSizeAndEpsilon(t *testing.T) { } defaultCheckFunc := func(w want, gotSize int, gotEpsilon float32) error { if !reflect.DeepEqual(gotSize, w.wantSize) { - return errors.Errorf("got = %v, want %v", gotSize, w.wantSize) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotSize, w.wantSize) } if !reflect.DeepEqual(gotEpsilon, w.wantEpsilon) { - return errors.Errorf("got = %v, want %v", gotEpsilon, w.wantEpsilon) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotEpsilon, w.wantEpsilon) } return nil } @@ -2397,7 +2397,7 @@ func Test_tofloat64(t *testing.T) { } defaultCheckFunc := func(w want, gotOut []float64) error { if !reflect.DeepEqual(gotOut, w.wantOut) { - return errors.Errorf("got = %v, want %v", gotOut, w.wantOut) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOut, w.wantOut) } return nil } diff --git a/hack/benchmark/internal/client/ngtd/rest/option_test.go b/hack/benchmark/internal/client/ngtd/rest/option_test.go index 3f6d7e91e3f..45609ede3ea 100644 --- a/hack/benchmark/internal/client/ngtd/rest/option_test.go +++ b/hack/benchmark/internal/client/ngtd/rest/option_test.go @@ -48,10 +48,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/core/gongt/gongt_test.go b/hack/benchmark/internal/core/gongt/gongt_test.go index 87609d3462a..c567c42415a 100644 --- a/hack/benchmark/internal/core/gongt/gongt_test.go +++ b/hack/benchmark/internal/core/gongt/gongt_test.go @@ -46,10 +46,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got icore.Core64, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -132,10 +132,10 @@ func Test_core_Search(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -242,10 +242,10 @@ func Test_core_Insert(t *testing.T) { } defaultCheckFunc := func(w want, got uint, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -347,10 +347,10 @@ func Test_core_InsertCommit(t *testing.T) { } defaultCheckFunc := func(w want, got uint, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -453,10 +453,10 @@ func Test_core_BulkInsert(t *testing.T) { } defaultCheckFunc := func(w want, got []uint, got1 []error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -558,10 +558,10 @@ func Test_core_BulkInsertCommit(t *testing.T) { } defaultCheckFunc := func(w want, got []uint, got1 []error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -663,7 +663,7 @@ func Test_core_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -763,7 +763,7 @@ func Test_core_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -863,7 +863,7 @@ func Test_core_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -963,7 +963,7 @@ func Test_core_BulkRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1064,10 +1064,10 @@ func Test_core_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float64, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1244,7 +1244,7 @@ func Test_toUint(t *testing.T) { } defaultCheckFunc := func(w want, gotOut []uint) error { if !reflect.DeepEqual(gotOut, w.wantOut) { - return errors.Errorf("got = %v, want %v", gotOut, w.wantOut) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOut, w.wantOut) } return nil } diff --git a/hack/benchmark/internal/core/gongt/option_test.go b/hack/benchmark/internal/core/gongt/option_test.go index a2eb14ab01d..2aa5f6465b7 100644 --- a/hack/benchmark/internal/core/gongt/option_test.go +++ b/hack/benchmark/internal/core/gongt/option_test.go @@ -48,10 +48,10 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -161,10 +161,10 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -174,7 +174,7 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -274,10 +274,10 @@ func TestWithDimension(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -287,7 +287,7 @@ func TestWithDimension(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/core/ngt/ngt_test.go b/hack/benchmark/internal/core/ngt/ngt_test.go index fd95e0beec4..e52dc99dd2a 100644 --- a/hack/benchmark/internal/core/ngt/ngt_test.go +++ b/hack/benchmark/internal/core/ngt/ngt_test.go @@ -46,10 +46,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got icore.Core32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -132,10 +132,10 @@ func Test_core_Search(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/core/ngt/option_test.go b/hack/benchmark/internal/core/ngt/option_test.go index 370c8bc2f4c..f69b30e2bbf 100644 --- a/hack/benchmark/internal/core/ngt/option_test.go +++ b/hack/benchmark/internal/core/ngt/option_test.go @@ -48,10 +48,10 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -161,10 +161,10 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -174,7 +174,7 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -274,10 +274,10 @@ func TestWithDimension(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -287,7 +287,7 @@ func TestWithDimension(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/e2e_test.go b/hack/benchmark/internal/e2e/e2e_test.go index bc84db4e0bd..4ba739a4028 100644 --- a/hack/benchmark/internal/e2e/e2e_test.go +++ b/hack/benchmark/internal/e2e/e2e_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Runner) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/option_test.go b/hack/benchmark/internal/e2e/option_test.go index c67f8c79c62..d7115e445d8 100644 --- a/hack/benchmark/internal/e2e/option_test.go +++ b/hack/benchmark/internal/e2e/option_test.go @@ -52,10 +52,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -165,10 +165,10 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -278,10 +278,10 @@ func TestWithStrategy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -291,7 +291,7 @@ func TestWithStrategy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -391,10 +391,10 @@ func TestWithServerStarter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithServerStarter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/create_index_option_test.go b/hack/benchmark/internal/e2e/strategy/create_index_option_test.go index 9cd77161bad..c39b7ffe90c 100644 --- a/hack/benchmark/internal/e2e/strategy/create_index_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/create_index_option_test.go @@ -50,10 +50,10 @@ func TestWithCreateIndexPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithCreateIndexPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithCreateIndexClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithCreateIndexClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/create_index_test.go b/hack/benchmark/internal/e2e/strategy/create_index_test.go index 2d3931502f9..0ff4804f8b7 100644 --- a/hack/benchmark/internal/e2e/strategy/create_index_test.go +++ b/hack/benchmark/internal/e2e/strategy/create_index_test.go @@ -45,7 +45,7 @@ func TestNewCreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/insert_option_test.go b/hack/benchmark/internal/e2e/strategy/insert_option_test.go index a046f99211f..5c87716deae 100644 --- a/hack/benchmark/internal/e2e/strategy/insert_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/insert_option_test.go @@ -48,10 +48,10 @@ func TestWithParallelInsert(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithParallelInsert(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/insert_test.go b/hack/benchmark/internal/e2e/strategy/insert_test.go index c0e2d9b8be9..874cbff1542 100644 --- a/hack/benchmark/internal/e2e/strategy/insert_test.go +++ b/hack/benchmark/internal/e2e/strategy/insert_test.go @@ -45,7 +45,7 @@ func TestNewInsert(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/remove_option_test.go b/hack/benchmark/internal/e2e/strategy/remove_option_test.go index 95f8d626dbc..357b287ad22 100644 --- a/hack/benchmark/internal/e2e/strategy/remove_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/remove_option_test.go @@ -48,10 +48,10 @@ func TestWithParallelRemove(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithParallelRemove(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/remove_test.go b/hack/benchmark/internal/e2e/strategy/remove_test.go index c3f52265865..8f47f20fb80 100644 --- a/hack/benchmark/internal/e2e/strategy/remove_test.go +++ b/hack/benchmark/internal/e2e/strategy/remove_test.go @@ -45,7 +45,7 @@ func TestNewRemove(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/search_option_test.go b/hack/benchmark/internal/e2e/strategy/search_option_test.go index 2ed0aa5fb6c..1aa1ed0e42d 100644 --- a/hack/benchmark/internal/e2e/strategy/search_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/search_option_test.go @@ -50,10 +50,10 @@ func TestWithSearchParallel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithSearchParallel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithSearchConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithSearchConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/search_test.go b/hack/benchmark/internal/e2e/strategy/search_test.go index b96d6cef217..54709730472 100644 --- a/hack/benchmark/internal/e2e/strategy/search_test.go +++ b/hack/benchmark/internal/e2e/strategy/search_test.go @@ -45,7 +45,7 @@ func TestNewSearch(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/stream_insert_test.go b/hack/benchmark/internal/e2e/strategy/stream_insert_test.go index f831b5a3c4c..a7390f96c1e 100644 --- a/hack/benchmark/internal/e2e/strategy/stream_insert_test.go +++ b/hack/benchmark/internal/e2e/strategy/stream_insert_test.go @@ -47,7 +47,7 @@ func TestNewStreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -121,7 +121,7 @@ func Test_streamInsert_dataProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() *client.ObjectVector) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/stream_remove_test.go b/hack/benchmark/internal/e2e/strategy/stream_remove_test.go index 0b626b2369a..c215517e2b6 100644 --- a/hack/benchmark/internal/e2e/strategy/stream_remove_test.go +++ b/hack/benchmark/internal/e2e/strategy/stream_remove_test.go @@ -47,7 +47,7 @@ func TestNewStreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -121,7 +121,7 @@ func Test_streamRemove_dataProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() *client.ObjectID) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go b/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go index 1e00c7e8341..b7832f1b2fa 100644 --- a/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go @@ -50,10 +50,10 @@ func TestWithStreamSearchConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithStreamSearchConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/strategy/stream_search_test.go b/hack/benchmark/internal/e2e/strategy/stream_search_test.go index caa432b673c..7962ccaf2da 100644 --- a/hack/benchmark/internal/e2e/strategy/stream_search_test.go +++ b/hack/benchmark/internal/e2e/strategy/stream_search_test.go @@ -47,7 +47,7 @@ func TestNewStreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, got e2e.Strategy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,7 +124,7 @@ func Test_streamSearch_dataProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() *client.SearchRequest) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/starter/agent/core/ngt/ngt_test.go b/hack/benchmark/internal/starter/agent/core/ngt/ngt_test.go index 6c10f201a86..54fb61c03e8 100644 --- a/hack/benchmark/internal/starter/agent/core/ngt/ngt_test.go +++ b/hack/benchmark/internal/starter/agent/core/ngt/ngt_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got starter.Starter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,7 +122,7 @@ func Test_server_Run(t *testing.T) { } defaultCheckFunc := func(w want, got func()) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/benchmark/internal/starter/agent/core/ngt/option_test.go b/hack/benchmark/internal/starter/agent/core/ngt/option_test.go index 40363d09182..de3345db4e9 100644 --- a/hack/benchmark/internal/starter/agent/core/ngt/option_test.go +++ b/hack/benchmark/internal/starter/agent/core/ngt/option_test.go @@ -50,10 +50,10 @@ func TestWithConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithDimentaion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithDimentaion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithDistanceType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithDistanceType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithObjectType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/starter/external/ngtd/ngtd_test.go b/hack/benchmark/internal/starter/external/ngtd/ngtd_test.go index 2deac100bd7..f47bd44ab88 100644 --- a/hack/benchmark/internal/starter/external/ngtd/ngtd_test.go +++ b/hack/benchmark/internal/starter/external/ngtd/ngtd_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got starter.Starter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,7 +124,7 @@ func Test_server_Run(t *testing.T) { } defaultCheckFunc := func(w want, got func()) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -218,7 +218,7 @@ func Test_server_createIndexDir(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -304,7 +304,7 @@ func Test_server_clearIndexDir(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/hack/benchmark/internal/starter/external/ngtd/option_test.go b/hack/benchmark/internal/starter/external/ngtd/option_test.go index 8b90cda1e7f..981a02e5d8e 100644 --- a/hack/benchmark/internal/starter/external/ngtd/option_test.go +++ b/hack/benchmark/internal/starter/external/ngtd/option_test.go @@ -48,10 +48,10 @@ func TestWithDimentaion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithDimentaion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -161,10 +161,10 @@ func TestWithServerType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -174,7 +174,7 @@ func TestWithServerType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -274,10 +274,10 @@ func TestWithIndexDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -287,7 +287,7 @@ func TestWithIndexDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -387,10 +387,10 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -400,7 +400,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/starter/gateway/vald/vald_test.go b/hack/benchmark/internal/starter/gateway/vald/vald_test.go index 408d61f309f..800af343c15 100644 --- a/hack/benchmark/internal/starter/gateway/vald/vald_test.go +++ b/hack/benchmark/internal/starter/gateway/vald/vald_test.go @@ -43,7 +43,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got starter.Starter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -115,7 +115,7 @@ func Test_server_Run(t *testing.T) { } defaultCheckFunc := func(w want, got func()) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/go.mod.default b/hack/go.mod.default index a6111245c69..3a12c430699 100755 --- a/hack/go.mod.default +++ b/hack/go.mod.default @@ -21,7 +21,7 @@ replace ( github.com/gorilla/websocket => github.com/gorilla/websocket latest github.com/hailocab/go-hostpool => github.com/monzo/go-hostpool latest github.com/hydrogen18/memlistener => github.com/hydrogen18/memlistener master - github.com/klauspost/compress => github.com/klauspost/compress latest + github.com/klauspost/compress => github.com/klauspost/compress master github.com/tensorflow/tensorflow => github.com/tensorflow/tensorflow v2.1.0 golang.org/x/crypto => golang.org/x/crypto latest google.golang.org/grpc => google.golang.org/grpc latest diff --git a/hack/helm/schema/gen/main_test.go b/hack/helm/schema/gen/main_test.go index f35030965d6..bb92edaf0b4 100644 --- a/hack/helm/schema/gen/main_test.go +++ b/hack/helm/schema/gen/main_test.go @@ -97,7 +97,7 @@ func Test_genJSONSchema(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -169,10 +169,10 @@ func Test_objectProperties(t *testing.T) { } defaultCheckFunc := func(w want, got map[string]*Schema, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -244,10 +244,10 @@ func Test_genNode(t *testing.T) { } defaultCheckFunc := func(w want, got *Schema, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -318,7 +318,7 @@ func Test_newRoot(t *testing.T) { } defaultCheckFunc := func(w want, got *Root) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/hack/license/gen/main_test.go b/hack/license/gen/main_test.go index 2e15acf7165..f0d7933188f 100644 --- a/hack/license/gen/main_test.go +++ b/hack/license/gen/main_test.go @@ -98,7 +98,7 @@ func Test_dirwalk(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -169,7 +169,7 @@ func Test_readAndRewrite(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/hack/swagger/main_test.go b/hack/swagger/main_test.go index f1d94748ef3..f4617fdbc9d 100644 --- a/hack/swagger/main_test.go +++ b/hack/swagger/main_test.go @@ -41,7 +41,7 @@ func TestParse(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/backoff/backoff_test.go b/internal/backoff/backoff_test.go index 1253790921e..b3c50f6eb4c 100644 --- a/internal/backoff/backoff_test.go +++ b/internal/backoff/backoff_test.go @@ -333,10 +333,10 @@ func Test_backoff_Do(t *testing.T) { } defaultCheckFunc := func(w want, gotRes interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -458,7 +458,7 @@ func Test_backoff_addJitter(t *testing.T) { } defaultCheckFunc := func(w want, got float64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/backoff/option_test.go b/internal/backoff/option_test.go index 6dc4544e26f..aba44ac613d 100644 --- a/internal/backoff/option_test.go +++ b/internal/backoff/option_test.go @@ -441,10 +441,10 @@ func TestWithEnableErrorLog(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -454,7 +454,7 @@ func TestWithEnableErrorLog(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/cache/cache_test.go b/internal/cache/cache_test.go index daf7e431cf9..0ad78738ac2 100644 --- a/internal/cache/cache_test.go +++ b/internal/cache/cache_test.go @@ -51,10 +51,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotCc Cache, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCc, w.wantCc) { - return errors.Errorf("got = %v, want %v", gotCc, w.wantCc) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCc, w.wantCc) } return nil } diff --git a/internal/cache/cacher/cacher_test.go b/internal/cache/cacher/cacher_test.go index ddbe79d514d..e47564b0256 100644 --- a/internal/cache/cacher/cacher_test.go +++ b/internal/cache/cacher/cacher_test.go @@ -38,7 +38,7 @@ func TestType_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -104,7 +104,7 @@ func TestToType(t *testing.T) { } defaultCheckFunc := func(w want, got Type) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/cache/gache/gache_test.go b/internal/cache/gache/gache_test.go index e797a0a0804..f8e851d4a65 100644 --- a/internal/cache/gache/gache_test.go +++ b/internal/cache/gache/gache_test.go @@ -63,7 +63,7 @@ func TestNew(t *testing.T) { }), } if diff := cmp.Diff(w.wantC, gotC, opts...); diff != "" { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -219,10 +219,10 @@ func Test_cache_Get(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -499,10 +499,10 @@ func Test_cache_GetAndDelete(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } diff --git a/internal/cache/gache/option_test.go b/internal/cache/gache/option_test.go index b5e77878920..e92eee77549 100644 --- a/internal/cache/gache/option_test.go +++ b/internal/cache/gache/option_test.go @@ -202,7 +202,7 @@ func TestWithExpiredHook(t *testing.T) { }, checkFunc: func(w want, g *T) error { if reflect.ValueOf(w.want.expiredHook).Pointer() != reflect.ValueOf(g.expiredHook).Pointer() { - return errors.Errorf("got = %v, want %v", g, w) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", g, w) } return nil }, diff --git a/internal/cache/option_test.go b/internal/cache/option_test.go index b41671a7723..87067fecff9 100644 --- a/internal/cache/option_test.go +++ b/internal/cache/option_test.go @@ -45,7 +45,7 @@ func TestWithExpiredHook(t *testing.T) { } defaultCheckFunc := func(w want, got *cache) error { if reflect.ValueOf(w.want.expiredHook).Pointer() != reflect.ValueOf(got.expiredHook).Pointer() { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -117,7 +117,7 @@ func TestWithType(t *testing.T) { } defaultCheckFunc := func(w want, got *cache) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -186,7 +186,7 @@ func TestWithExpireDuration(t *testing.T) { } defaultCheckFunc := func(w want, got *cache) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -268,7 +268,7 @@ func TestWithExpireCheckDuration(t *testing.T) { } defaultCheckFunc := func(w want, got *cache) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/client/agent/grpc/client_test.go b/internal/client/agent/grpc/client_test.go index 10a7932962c..6080e6580df 100644 --- a/internal/client/agent/grpc/client_test.go +++ b/internal/client/agent/grpc/client_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -132,10 +132,10 @@ func Test_agentClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -231,10 +231,10 @@ func Test_agentClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -330,10 +330,10 @@ func Test_agentClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -429,7 +429,7 @@ func Test_agentClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -527,7 +527,7 @@ func Test_agentClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -624,7 +624,7 @@ func Test_agentClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -720,7 +720,7 @@ func Test_agentClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -817,7 +817,7 @@ func Test_agentClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -912,7 +912,7 @@ func Test_agentClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1008,7 +1008,7 @@ func Test_agentClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1105,7 +1105,7 @@ func Test_agentClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1200,7 +1200,7 @@ func Test_agentClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1296,7 +1296,7 @@ func Test_agentClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1393,7 +1393,7 @@ func Test_agentClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1489,10 +1489,10 @@ func Test_agentClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1588,7 +1588,7 @@ func Test_agentClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1685,7 +1685,7 @@ func Test_agentClient_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1779,7 +1779,7 @@ func Test_agentClient_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1872,7 +1872,7 @@ func Test_agentClient_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1967,10 +1967,10 @@ func Test_agentClient_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, got *client.InfoIndex, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2058,7 +2058,7 @@ func Test_streamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2135,7 +2135,7 @@ func Test_stream(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/client/agent/grpc/option_test.go b/internal/client/agent/grpc/option_test.go index cd04e68fbe5..9d318f3cbed 100644 --- a/internal/client/agent/grpc/option_test.go +++ b/internal/client/agent/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithGRPCClientOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithGRPCClientOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/client/agent/rest/client_test.go b/internal/client/agent/rest/client_test.go index 8ed55630a4a..92a43ca7d44 100644 --- a/internal/client/agent/rest/client_test.go +++ b/internal/client/agent/rest/client_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -125,10 +125,10 @@ func Test_agentClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -216,10 +216,10 @@ func Test_agentClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -307,10 +307,10 @@ func Test_agentClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -398,7 +398,7 @@ func Test_agentClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -488,7 +488,7 @@ func Test_agentClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -577,7 +577,7 @@ func Test_agentClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -665,7 +665,7 @@ func Test_agentClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -754,7 +754,7 @@ func Test_agentClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -841,7 +841,7 @@ func Test_agentClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -929,7 +929,7 @@ func Test_agentClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1018,7 +1018,7 @@ func Test_agentClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1105,7 +1105,7 @@ func Test_agentClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1193,7 +1193,7 @@ func Test_agentClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1282,7 +1282,7 @@ func Test_agentClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1370,10 +1370,10 @@ func Test_agentClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *client.ObjectVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1461,7 +1461,7 @@ func Test_agentClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1550,7 +1550,7 @@ func Test_agentClient_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1636,7 +1636,7 @@ func Test_agentClient_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1721,7 +1721,7 @@ func Test_agentClient_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1808,10 +1808,10 @@ func Test_agentClient_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *client.InfoIndex, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/internal/client/agent/rest/option_test.go b/internal/client/agent/rest/option_test.go index 1390f7e458c..d93607dad6c 100644 --- a/internal/client/agent/rest/option_test.go +++ b/internal/client/agent/rest/option_test.go @@ -48,10 +48,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/client/compressor/client_test.go b/internal/client/compressor/client_test.go index db576499b6a..e7731dfd2b6 100644 --- a/internal/client/compressor/client_test.go +++ b/internal/client/compressor/client_test.go @@ -47,10 +47,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotC Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -127,10 +127,10 @@ func Test_client_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -220,10 +220,10 @@ func Test_client_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, gotVec *payload.Backup_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -315,10 +315,10 @@ func Test_client_GetLocation(t *testing.T) { } defaultCheckFunc := func(w want, gotIpList []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIpList, w.wantIpList) { - return errors.Errorf("got = %v, want %v", gotIpList, w.wantIpList) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIpList, w.wantIpList) } return nil } @@ -409,7 +409,7 @@ func Test_client_Register(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -500,7 +500,7 @@ func Test_client_RegisterMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -591,7 +591,7 @@ func Test_client_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -682,7 +682,7 @@ func Test_client_RemoveMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -773,7 +773,7 @@ func Test_client_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -864,7 +864,7 @@ func Test_client_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/client/compressor/option_test.go b/internal/client/compressor/option_test.go index d0e75d4815f..5adf6959382 100644 --- a/internal/client/compressor/option_test.go +++ b/internal/client/compressor/option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/client/discoverer/discover_test.go b/internal/client/discoverer/discover_test.go index b732d70cb30..dffc3bd2732 100644 --- a/internal/client/discoverer/discover_test.go +++ b/internal/client/discoverer/discover_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotD Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotD, w.wantD) { - return errors.Errorf("got = %v, want %v", gotD, w.wantD) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotD, w.wantD) } return nil } @@ -143,10 +143,10 @@ func Test_client_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -290,7 +290,7 @@ func Test_client_GetAddrs(t *testing.T) { } defaultCheckFunc := func(w want, gotAddrs []string) error { if !reflect.DeepEqual(gotAddrs, w.wantAddrs) { - return errors.Errorf("got = %v, want %v", gotAddrs, w.wantAddrs) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotAddrs, w.wantAddrs) } return nil } @@ -430,7 +430,7 @@ func Test_client_GetClient(t *testing.T) { } defaultCheckFunc := func(w want, got grpc.Client) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -569,7 +569,7 @@ func Test_client_connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -716,7 +716,7 @@ func Test_client_disconnect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -864,10 +864,10 @@ func Test_client_dnsDiscovery(t *testing.T) { } defaultCheckFunc := func(w want, gotAddrs []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotAddrs, w.wantAddrs) { - return errors.Errorf("got = %v, want %v", gotAddrs, w.wantAddrs) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotAddrs, w.wantAddrs) } return nil } @@ -1014,7 +1014,7 @@ func Test_client_discover(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/client/discoverer/option_test.go b/internal/client/discoverer/option_test.go index 716f550c028..edbd193b883 100644 --- a/internal/client/discoverer/option_test.go +++ b/internal/client/discoverer/option_test.go @@ -52,10 +52,10 @@ func TestWithOnDiscoverFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithOnDiscoverFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -165,10 +165,10 @@ func TestWithOnConnectFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithOnConnectFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -278,10 +278,10 @@ func TestWithOnDisconnectFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -291,7 +291,7 @@ func TestWithOnDisconnectFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -391,10 +391,10 @@ func TestWithDiscovererClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithDiscovererClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -504,10 +504,10 @@ func TestWithDiscovererAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -517,7 +517,7 @@ func TestWithDiscovererAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -618,10 +618,10 @@ func TestWithDiscovererHostPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -631,7 +631,7 @@ func TestWithDiscovererHostPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -733,10 +733,10 @@ func TestWithDiscoverDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -746,7 +746,7 @@ func TestWithDiscoverDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -846,10 +846,10 @@ func TestWithOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -859,7 +859,7 @@ func TestWithOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -959,10 +959,10 @@ func TestWithAutoConnect(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -972,7 +972,7 @@ func TestWithAutoConnect(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1072,10 +1072,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1085,7 +1085,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1185,10 +1185,10 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1198,7 +1198,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1298,10 +1298,10 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1311,7 +1311,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1411,10 +1411,10 @@ func TestWithServiceDNSARecord(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1424,7 +1424,7 @@ func TestWithServiceDNSARecord(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1524,10 +1524,10 @@ func TestWithNodeName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1537,7 +1537,7 @@ func TestWithNodeName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1637,10 +1637,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1650,7 +1650,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/client/gateway/vald/grpc/client_test.go b/internal/client/gateway/vald/grpc/client_test.go index 7c0ea6c23e3..2f31ca08e35 100644 --- a/internal/client/gateway/vald/grpc/client_test.go +++ b/internal/client/gateway/vald/grpc/client_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -134,10 +134,10 @@ func Test_gatewayClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -233,10 +233,10 @@ func Test_gatewayClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -332,10 +332,10 @@ func Test_gatewayClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, got *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -431,7 +431,7 @@ func Test_gatewayClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -529,7 +529,7 @@ func Test_gatewayClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -626,7 +626,7 @@ func Test_gatewayClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -722,7 +722,7 @@ func Test_gatewayClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -819,7 +819,7 @@ func Test_gatewayClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -914,7 +914,7 @@ func Test_gatewayClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1010,7 +1010,7 @@ func Test_gatewayClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1107,7 +1107,7 @@ func Test_gatewayClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1202,7 +1202,7 @@ func Test_gatewayClient_Upsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1297,7 +1297,7 @@ func Test_gatewayClient_MultiUpsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1393,7 +1393,7 @@ func Test_gatewayClient_StreamUpsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1490,7 +1490,7 @@ func Test_gatewayClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1586,7 +1586,7 @@ func Test_gatewayClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1683,7 +1683,7 @@ func Test_gatewayClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1779,10 +1779,10 @@ func Test_gatewayClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, got *client.MetaObject, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1878,7 +1878,7 @@ func Test_gatewayClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1970,7 +1970,7 @@ func Test_streamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2047,7 +2047,7 @@ func Test_stream(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/client/gateway/vald/grpc/option_test.go b/internal/client/gateway/vald/grpc/option_test.go index f59f130c0d2..48733e2b787 100644 --- a/internal/client/gateway/vald/grpc/option_test.go +++ b/internal/client/gateway/vald/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithGRPCClientConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithGRPCClientConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/client/gateway/vald/rest/client_test.go b/internal/client/gateway/vald/rest/client_test.go index c2ba19d3d37..0fe7931da9e 100644 --- a/internal/client/gateway/vald/rest/client_test.go +++ b/internal/client/gateway/vald/rest/client_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Client) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_gatewayClient_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotResp *client.ObjectID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResp, w.wantResp) { - return errors.Errorf("got = %v, want %v", gotResp, w.wantResp) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResp, w.wantResp) } return nil } @@ -213,10 +213,10 @@ func Test_gatewayClient_Search(t *testing.T) { } defaultCheckFunc := func(w want, gotResp *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResp, w.wantResp) { - return errors.Errorf("got = %v, want %v", gotResp, w.wantResp) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResp, w.wantResp) } return nil } @@ -304,10 +304,10 @@ func Test_gatewayClient_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotResp *client.SearchResponse, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResp, w.wantResp) { - return errors.Errorf("got = %v, want %v", gotResp, w.wantResp) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResp, w.wantResp) } return nil } @@ -395,7 +395,7 @@ func Test_gatewayClient_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -485,7 +485,7 @@ func Test_gatewayClient_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -574,7 +574,7 @@ func Test_gatewayClient_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -662,7 +662,7 @@ func Test_gatewayClient_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -751,7 +751,7 @@ func Test_gatewayClient_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -838,7 +838,7 @@ func Test_gatewayClient_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -926,7 +926,7 @@ func Test_gatewayClient_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1015,7 +1015,7 @@ func Test_gatewayClient_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1102,7 +1102,7 @@ func Test_gatewayClient_Upsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1189,7 +1189,7 @@ func Test_gatewayClient_MultiUpsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1277,7 +1277,7 @@ func Test_gatewayClient_StreamUpsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1366,7 +1366,7 @@ func Test_gatewayClient_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1454,7 +1454,7 @@ func Test_gatewayClient_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1543,7 +1543,7 @@ func Test_gatewayClient_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1631,10 +1631,10 @@ func Test_gatewayClient_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotResp *client.MetaObject, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResp, w.wantResp) { - return errors.Errorf("got = %v, want %v", gotResp, w.wantResp) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResp, w.wantResp) } return nil } @@ -1722,7 +1722,7 @@ func Test_gatewayClient_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/client/gateway/vald/rest/option_test.go b/internal/client/gateway/vald/rest/option_test.go index a88fe9defa8..65bbdba7426 100644 --- a/internal/client/gateway/vald/rest/option_test.go +++ b/internal/client/gateway/vald/rest/option_test.go @@ -48,10 +48,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/compress/gob_test.go b/internal/compress/gob_test.go index 32318febb9d..2c9c51335d1 100644 --- a/internal/compress/gob_test.go +++ b/internal/compress/gob_test.go @@ -46,10 +46,10 @@ func TestNewGob(t *testing.T) { } defaultCheckFunc := func(w want, got Compressor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -125,10 +125,10 @@ func Test_gobCompressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -226,14 +226,14 @@ func Test_E2E_gobCompressor_CompressVector(t *testing.T) { defaultCheckFunc := func(w want, got []byte, err error, l Compressor) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } decompressed, err := l.DecompressVector(got) if err != nil { return errors.Errorf("decompress error: %v", err) } if !reflect.DeepEqual(decompressed, w.want) { - return errors.Errorf("got = %v, want %v", decompressed, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", decompressed, w.want) } return nil } @@ -297,10 +297,10 @@ func Test_gobCompressor_DecompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -401,10 +401,10 @@ func Test_gobCompressor_Reader(t *testing.T) { } defaultCheckFunc := func(w want, got io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -482,10 +482,10 @@ func Test_gobCompressor_Writer(t *testing.T) { } defaultCheckFunc := func(w want, got io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -563,10 +563,10 @@ func Test_gobReader_Read(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -651,7 +651,7 @@ func Test_gobReader_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -718,10 +718,10 @@ func Test_gobWriter_Write(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -806,7 +806,7 @@ func Test_gobWriter_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/compress/gzip_option_test.go b/internal/compress/gzip_option_test.go index 3142fbd65b4..2c24baf4277 100644 --- a/internal/compress/gzip_option_test.go +++ b/internal/compress/gzip_option_test.go @@ -45,10 +45,10 @@ func TestWithGzipGob(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -113,10 +113,10 @@ func TestWithGzipCompressionLevel(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/compress/gzip_test.go b/internal/compress/gzip_test.go index 44b1e32745b..da9dbb79077 100644 --- a/internal/compress/gzip_test.go +++ b/internal/compress/gzip_test.go @@ -45,10 +45,10 @@ func TestNewGzip(t *testing.T) { } defaultCheckFunc := func(w want, got Compressor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -131,10 +131,10 @@ func Test_gzipCompressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error, _ *gzipCompressor) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -318,14 +318,14 @@ func Test_E2E_gzipCompressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error, g Compressor) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } decompressed, err := g.DecompressVector(got) if err != nil { return errors.Errorf("decompress error: %v", err) } if !reflect.DeepEqual(decompressed, w.want) { - return errors.Errorf("decompressed got = %v, want %v", got, w.want) + return errors.Errorf("decompressed got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_gzipCompressor_DecompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float32, err error, _ *gzipCompressor) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -533,10 +533,10 @@ func Test_gzipCompressor_Reader(t *testing.T) { } defaultCheckFunc := func(w want, got io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -636,10 +636,10 @@ func Test_gzipCompressor_Writer(t *testing.T) { } defaultCheckFunc := func(w want, got io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -740,10 +740,10 @@ func Test_gzipReader_Read(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -811,7 +811,7 @@ func Test_gzipReader_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -942,10 +942,10 @@ func Test_gzipWriter_Write(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -1013,7 +1013,7 @@ func Test_gzipWriter_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/compress/lz4_option_test.go b/internal/compress/lz4_option_test.go index aad0fea787e..2b3aa1717be 100644 --- a/internal/compress/lz4_option_test.go +++ b/internal/compress/lz4_option_test.go @@ -45,10 +45,10 @@ func TestWithLZ4Gob(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -112,10 +112,10 @@ func TestWithLZ4CompressionLevel(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/compress/lz4_test.go b/internal/compress/lz4_test.go index bfa0040a33f..64bbb433ee5 100644 --- a/internal/compress/lz4_test.go +++ b/internal/compress/lz4_test.go @@ -45,10 +45,10 @@ func TestNewLZ4(t *testing.T) { } defaultCheckFunc := func(w want, got Compressor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -149,10 +149,10 @@ func Test_lz4Compressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -343,14 +343,14 @@ func Test_E2E_lz4Compressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error, l Compressor) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } decompressed, err := l.DecompressVector(got) if err != nil { return errors.Errorf("decompress error: %v", err) } if !reflect.DeepEqual(decompressed, w.want) { - return errors.Errorf("got = %v, want %v", decompressed, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", decompressed, w.want) } return nil } @@ -416,10 +416,10 @@ func Test_lz4Compressor_DecompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -553,10 +553,10 @@ func Test_lz4Compressor_Reader(t *testing.T) { } defaultCheckFunc := func(w want, got io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -639,10 +639,10 @@ func Test_lz4Compressor_Writer(t *testing.T) { } defaultCheckFunc := func(w want, got io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -724,10 +724,10 @@ func Test_lz4Reader_Read(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -795,7 +795,7 @@ func Test_lz4Reader_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -869,10 +869,10 @@ func Test_lz4Writer_Write(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -940,7 +940,7 @@ func Test_lz4Writer_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/compress/zstd_option_test.go b/internal/compress/zstd_option_test.go index cae0ba82239..d45f98639d2 100644 --- a/internal/compress/zstd_option_test.go +++ b/internal/compress/zstd_option_test.go @@ -47,10 +47,10 @@ func TestWithZstdGob(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -114,7 +114,7 @@ func TestWithZstdCompressionLevel(t *testing.T) { } defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } zstdComparator := []comparator.Option{ diff --git a/internal/compress/zstd_test.go b/internal/compress/zstd_test.go index 5b3eb28cc9c..9b4b81b1653 100644 --- a/internal/compress/zstd_test.go +++ b/internal/compress/zstd_test.go @@ -84,10 +84,10 @@ func TestNewZstd(t *testing.T) { } defaultCheckFunc := func(w want, got Compressor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -164,10 +164,10 @@ func Test_zstdCompressor_CompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -256,10 +256,10 @@ func Test_zstdCompressor_DecompressVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -348,10 +348,10 @@ func Test_zstdCompressor_Reader(t *testing.T) { } defaultCheckFunc := func(w want, got io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -440,10 +440,10 @@ func Test_zstdCompressor_Writer(t *testing.T) { } defaultCheckFunc := func(w want, got io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -532,10 +532,10 @@ func Test_zstdReader_Read(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -619,7 +619,7 @@ func Test_zstdReader_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -702,10 +702,10 @@ func Test_zstdWriter_Write(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -789,7 +789,7 @@ func Test_zstdWriter_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/config/backoff_test.go b/internal/config/backoff_test.go index 2c9450ee48e..9067db0bcfc 100644 --- a/internal/config/backoff_test.go +++ b/internal/config/backoff_test.go @@ -48,7 +48,7 @@ func TestBackoff_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Backoff) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -145,7 +145,7 @@ func TestBackoff_Opts(t *testing.T) { } defaultCheckFunc := func(w want, got []backoff.Option) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/backup_test.go b/internal/config/backup_test.go index 46bffa7252f..cfcc345115b 100644 --- a/internal/config/backup_test.go +++ b/internal/config/backup_test.go @@ -43,7 +43,7 @@ func TestBackupManager_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *BackupManager) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/blob_test.go b/internal/config/blob_test.go index e7a65513bb3..eb317ce3fb9 100644 --- a/internal/config/blob_test.go +++ b/internal/config/blob_test.go @@ -39,7 +39,7 @@ func TestBlobStorageType_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -104,7 +104,7 @@ func TestAtoBST(t *testing.T) { } defaultCheckFunc := func(w want, got BlobStorageType) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -177,7 +177,7 @@ func TestBlob_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Blob) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -273,7 +273,7 @@ func TestS3Config_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *S3Config) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/cassandra_test.go b/internal/config/cassandra_test.go index a8fd042d625..d6b1fa85c57 100644 --- a/internal/config/cassandra_test.go +++ b/internal/config/cassandra_test.go @@ -78,7 +78,7 @@ func TestCassandra_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Cassandra) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -289,10 +289,10 @@ func TestCassandra_Opts(t *testing.T) { } defaultCheckFunc := func(w want, gotOpts []cassandra.Option, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotOpts, w.wantOpts) { - return errors.Errorf("got = %v, want %v", gotOpts, w.wantOpts) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOpts, w.wantOpts) } return nil } diff --git a/internal/config/client_test.go b/internal/config/client_test.go index c77d5085dbe..5c1db48ee25 100644 --- a/internal/config/client_test.go +++ b/internal/config/client_test.go @@ -42,7 +42,7 @@ func TestClient_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Client) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/compress_test.go b/internal/config/compress_test.go index cf0051245b0..a1a575ddb85 100644 --- a/internal/config/compress_test.go +++ b/internal/config/compress_test.go @@ -39,7 +39,7 @@ func Test_compressAlgorithm_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -104,7 +104,7 @@ func TestCompressAlgorithm(t *testing.T) { } defaultCheckFunc := func(w want, got compressAlgorithm) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -176,7 +176,7 @@ func TestCompressCore_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *CompressCore) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -255,7 +255,7 @@ func TestCompressor_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Compressor) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -337,7 +337,7 @@ func TestCompressorRegisterer_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *CompressorRegisterer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 50c7791b184..ac6ff437023 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -44,7 +44,7 @@ func TestGlobalConfig_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *GlobalConfig) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -130,7 +130,7 @@ func TestGlobalConfig_UnmarshalJSON(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -217,7 +217,7 @@ func TestRead(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -290,7 +290,7 @@ func TestGetActualValue(t *testing.T) { } defaultCheckFunc := func(w want, gotRes string) error { if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -361,7 +361,7 @@ func TestGetActualValues(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -434,7 +434,7 @@ func Test_checkPrefixAndSuffix(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -509,7 +509,7 @@ func TestToRawYaml(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/debug_test.go b/internal/config/debug_test.go index 03a33402063..c3b98c3f0a3 100644 --- a/internal/config/debug_test.go +++ b/internal/config/debug_test.go @@ -48,7 +48,7 @@ func TestDebug_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Debug) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/discoverer_test.go b/internal/config/discoverer_test.go index f94fdcea650..ec218111925 100644 --- a/internal/config/discoverer_test.go +++ b/internal/config/discoverer_test.go @@ -43,7 +43,7 @@ func TestDiscoverer_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Discoverer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -126,7 +126,7 @@ func TestDiscovererClient_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *DiscovererClient) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/filter_test.go b/internal/config/filter_test.go index 7c8a0196502..e5f4d3b7ef8 100644 --- a/internal/config/filter_test.go +++ b/internal/config/filter_test.go @@ -41,7 +41,7 @@ func TestEgressFilter_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *EgressFilter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/gateway_test.go b/internal/config/gateway_test.go index f91053ba795..e2fcdcb4d48 100644 --- a/internal/config/gateway_test.go +++ b/internal/config/gateway_test.go @@ -50,7 +50,7 @@ func TestGateway_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Gateway) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/grpc_test.go b/internal/config/grpc_test.go index 5335cc56763..47ea7fbcd56 100644 --- a/internal/config/grpc_test.go +++ b/internal/config/grpc_test.go @@ -38,7 +38,7 @@ func Test_newGRPCClientConfig(t *testing.T) { } defaultCheckFunc := func(w want, got *GRPCClient) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -108,7 +108,7 @@ func TestGRPCClient_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *GRPCClient) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -201,7 +201,7 @@ func TestGRPCClientKeepalive_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *GRPCClientKeepalive) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -283,7 +283,7 @@ func TestCallOption_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *CallOption) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -375,7 +375,7 @@ func TestDialOption_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *DialOption) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -484,7 +484,7 @@ func TestGRPCClient_Opts(t *testing.T) { } defaultCheckFunc := func(w want, got []grpc.Option) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/index_test.go b/internal/config/index_test.go index 39b8fb3252e..24687d41450 100644 --- a/internal/config/index_test.go +++ b/internal/config/index_test.go @@ -51,7 +51,7 @@ func TestIndexer_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Indexer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/log_test.go b/internal/config/log_test.go index d36f8d2773f..fd77f4c945a 100644 --- a/internal/config/log_test.go +++ b/internal/config/log_test.go @@ -44,7 +44,7 @@ func TestLogging_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Logging) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/meta_test.go b/internal/config/meta_test.go index df5056633b9..580c0213c25 100644 --- a/internal/config/meta_test.go +++ b/internal/config/meta_test.go @@ -46,7 +46,7 @@ func TestMeta_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Meta) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/mysql_test.go b/internal/config/mysql_test.go index c90d33cfd88..02281e34d30 100644 --- a/internal/config/mysql_test.go +++ b/internal/config/mysql_test.go @@ -56,7 +56,7 @@ func TestMySQL_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *MySQL) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/ngt_test.go b/internal/config/ngt_test.go index d269f2bbe1c..df04a9e6628 100644 --- a/internal/config/ngt_test.go +++ b/internal/config/ngt_test.go @@ -54,7 +54,7 @@ func TestNGT_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *NGT) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/observability_test.go b/internal/config/observability_test.go index 26ac1d74a3c..d331f5800a2 100644 --- a/internal/config/observability_test.go +++ b/internal/config/observability_test.go @@ -47,7 +47,7 @@ func TestObservability_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Observability) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -137,7 +137,7 @@ func TestCollector_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Collector) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -217,7 +217,7 @@ func TestStackdriver_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Stackdriver) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/redis_test.go b/internal/config/redis_test.go index b660339e757..da6dd621325 100644 --- a/internal/config/redis_test.go +++ b/internal/config/redis_test.go @@ -67,7 +67,7 @@ func TestRedis_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Redis) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/server_test.go b/internal/config/server_test.go index 343d2fcc2df..60a64c4380c 100644 --- a/internal/config/server_test.go +++ b/internal/config/server_test.go @@ -48,7 +48,7 @@ func TestServers_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Servers) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -145,7 +145,7 @@ func TestServers_GetGRPCStreamConcurrency(t *testing.T) { } defaultCheckFunc := func(w want, gotC int) error { if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -241,7 +241,7 @@ func TestHTTP_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *HTTP) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -340,7 +340,7 @@ func TestGRPC_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *GRPC) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -450,7 +450,7 @@ func TestGRPCKeepalive_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *GRPCKeepalive) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -542,7 +542,7 @@ func TestServer_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -643,7 +643,7 @@ func TestServer_Opts(t *testing.T) { } defaultCheckFunc := func(w want, got []server.Option) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/sidecar_test.go b/internal/config/sidecar_test.go index 73b06c628c4..d665117f365 100644 --- a/internal/config/sidecar_test.go +++ b/internal/config/sidecar_test.go @@ -50,7 +50,7 @@ func TestAgentSidecar_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *AgentSidecar) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/tcp_test.go b/internal/config/tcp_test.go index db04b0a7b43..702f5c85120 100644 --- a/internal/config/tcp_test.go +++ b/internal/config/tcp_test.go @@ -44,7 +44,7 @@ func TestDNS_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *DNS) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -125,7 +125,7 @@ func TestDialer_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Dialer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -206,7 +206,7 @@ func TestTCP_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *TCP) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -287,7 +287,7 @@ func TestTCP_Opts(t *testing.T) { } defaultCheckFunc := func(w want, got []tcp.DialerOption) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/config/tls_test.go b/internal/config/tls_test.go index b8bb9b447bf..49bd9946539 100644 --- a/internal/config/tls_test.go +++ b/internal/config/tls_test.go @@ -46,7 +46,7 @@ func TestTLS_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *TLS) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -161,7 +161,7 @@ func TestTLS_Opts(t *testing.T) { } } if !ok { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } } return nil diff --git a/internal/config/transport_test.go b/internal/config/transport_test.go index 8cd7d71e957..ba0fc5546db 100644 --- a/internal/config/transport_test.go +++ b/internal/config/transport_test.go @@ -51,7 +51,7 @@ func TestRoundTripper_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *RoundTripper) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -155,7 +155,7 @@ func TestTransport_Bind(t *testing.T) { } defaultCheckFunc := func(w want, got *Transport) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/core/converter/tensorflow/option_test.go b/internal/core/converter/tensorflow/option_test.go index c22600329d5..b7fd838bfc4 100644 --- a/internal/core/converter/tensorflow/option_test.go +++ b/internal/core/converter/tensorflow/option_test.go @@ -47,7 +47,7 @@ func TestWithSessionOptions(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -114,7 +114,7 @@ func TestWithSessionTarget(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -183,7 +183,7 @@ func TestWithSessionConfig(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -256,7 +256,7 @@ func TestWithOperations(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -339,7 +339,7 @@ func TestWithExportPath(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -410,7 +410,7 @@ func TestWithTags(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -588,7 +588,7 @@ func TestWithFeed(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -656,7 +656,7 @@ func TestWithFeeds(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -762,7 +762,7 @@ func TestWithFetch(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -830,7 +830,7 @@ func TestWithFetches(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -939,7 +939,7 @@ func TestWithWarmupInputs(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1033,7 +1033,7 @@ func TestWithNdim(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/core/converter/tensorflow/tensorflow_test.go b/internal/core/converter/tensorflow/tensorflow_test.go index 49cb28bded9..516979453f1 100644 --- a/internal/core/converter/tensorflow/tensorflow_test.go +++ b/internal/core/converter/tensorflow/tensorflow_test.go @@ -50,7 +50,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got TF, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } opts := []cmp.Option{ @@ -203,7 +203,7 @@ func Test_tensorflow_warmup(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -294,7 +294,7 @@ func Test_tensorflow_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -372,10 +372,10 @@ func Test_tensorflow_run(t *testing.T) { } defaultCheckFunc := func(w want, got []*tf.Tensor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -494,10 +494,10 @@ func Test_tensorflow_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got []float64, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -726,10 +726,10 @@ func Test_tensorflow_GetValue(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -838,10 +838,10 @@ func Test_tensorflow_GetValues(t *testing.T) { } defaultCheckFunc := func(w want, gotValues []interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotValues, w.wantValues) { - return errors.Errorf("got = %v, want %v", gotValues, w.wantValues) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValues, w.wantValues) } return nil } diff --git a/internal/db/kvs/redis/option_test.go b/internal/db/kvs/redis/option_test.go index 970e234fc3a..ef13828c5a6 100644 --- a/internal/db/kvs/redis/option_test.go +++ b/internal/db/kvs/redis/option_test.go @@ -51,11 +51,11 @@ func TestWithDialer(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil @@ -141,7 +141,7 @@ func TestWithDialerFunc(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.dialerFunc).Pointer() != reflect.ValueOf(obj.dialerFunc).Pointer() { @@ -227,10 +227,10 @@ func TestWithAddrs(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -334,10 +334,10 @@ func TestWithDB(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -399,7 +399,7 @@ func TestWithClusterSlots(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.clusterSlots).Pointer() != reflect.ValueOf(obj.clusterSlots).Pointer() { return errors.Errorf("got dialer = %p, want %p", obj.dialer, w.obj.dialer) @@ -483,10 +483,10 @@ func TestWithDialTimeout(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -570,10 +570,10 @@ func TestWithIdleCheckFrequency(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -657,10 +657,10 @@ func TestWithIdleTimeout(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -744,10 +744,10 @@ func TestWithKeyPrefix(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -819,10 +819,10 @@ func TestWithMaximumConnectionAge(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -904,10 +904,10 @@ func TestWithRedirectLimit(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -969,10 +969,10 @@ func TestWithRetryLimit(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1034,10 +1034,10 @@ func TestWithMaximumRetryBackoff(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1121,10 +1121,10 @@ func TestWithMinimumIdleConnection(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1186,10 +1186,10 @@ func TestWithMinimumRetryBackoff(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1273,7 +1273,7 @@ func TestWithOnConnectFunction(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onConnect).Pointer() != reflect.ValueOf(obj.onConnect).Pointer() { return errors.Errorf("got onConnect = %p, want %p", obj.onConnect, w.obj.onConnect) @@ -1355,7 +1355,7 @@ func TestWithOnNewNodeFunction(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onNewNode).Pointer() != reflect.ValueOf(obj.onNewNode).Pointer() { return errors.Errorf("got onNewNode = %p, want %p", obj.onNewNode, w.obj.onNewNode) @@ -1435,10 +1435,10 @@ func TestWithPassword(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1510,10 +1510,10 @@ func TestWithPoolSize(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1575,10 +1575,10 @@ func TestWithPoolTimeout(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1662,10 +1662,10 @@ func TestWithReadOnlyFlag(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1727,10 +1727,10 @@ func TestWithReadTimeout(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1814,10 +1814,10 @@ func TestWithRouteByLatencyFlag(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1879,10 +1879,10 @@ func TestWithRouteRandomlyFlag(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1944,10 +1944,10 @@ func TestWithTLSConfig(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2024,10 +2024,10 @@ func TestWithWriteTimeout(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2111,10 +2111,10 @@ func TestWithInitialPingTimeLimit(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2198,10 +2198,10 @@ func TestWithInitialPingDuration(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2289,10 +2289,10 @@ func TestWithHooks(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/db/kvs/redis/redis_test.go b/internal/db/kvs/redis/redis_test.go index 45d5fce0372..ee5ee642998 100644 --- a/internal/db/kvs/redis/redis_test.go +++ b/internal/db/kvs/redis/redis_test.go @@ -68,7 +68,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotRc Connector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(w.wantRc, gotRc) { return errors.Errorf("got = %v, want = %v", gotRc, w.wantRc) @@ -105,7 +105,7 @@ func TestNew(t *testing.T) { }, checkFunc: func(w want, gotRc Connector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil @@ -159,10 +159,10 @@ func Test_redisClient_ping(t *testing.T) { } defaultCheckFunc := func(w want, gotR Redis, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -296,7 +296,7 @@ func Test_redisClient_setClient(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -466,10 +466,10 @@ func Test_redisClient_newSentinelClient(t *testing.T) { } defaultCheckFunc := func(w want, got *redis.Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -545,7 +545,7 @@ func Test_redisClient_newSentinelClient(t *testing.T) { }, checkFunc: func(w want, gotc *redis.Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if gotc == nil { return errors.New("got is nil") @@ -687,10 +687,10 @@ func Test_redisClient_newClusterClient(t *testing.T) { } defaultCheckFunc := func(w want, got *redis.ClusterClient, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -782,7 +782,7 @@ func Test_redisClient_newClusterClient(t *testing.T) { }, checkFunc: func(w want, gotc *redis.ClusterClient, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if gotc == nil { return errors.New("got is nil") @@ -934,10 +934,10 @@ func Test_redisClient_Connect(t *testing.T) { } defaultCheckFunc := func(w want, got Redis, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/db/nosql/cassandra/cassandra_test.go b/internal/db/nosql/cassandra/cassandra_test.go index b9ba9a23c9e..d47c9497860 100644 --- a/internal/db/nosql/cassandra/cassandra_test.go +++ b/internal/db/nosql/cassandra/cassandra_test.go @@ -47,10 +47,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Cassandra, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -182,7 +182,7 @@ func Test_client_Open(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -443,7 +443,7 @@ func Test_client_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -705,7 +705,7 @@ func Test_client_Query(t *testing.T) { } defaultCheckFunc := func(w want, got *Queryx) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -910,10 +910,10 @@ func TestSelect(t *testing.T) { } defaultCheckFunc := func(w want, gotStmt string, gotNames []string) error { if !reflect.DeepEqual(gotStmt, w.wantStmt) { - return errors.Errorf("got = %v, want %v", gotStmt, w.wantStmt) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotStmt, w.wantStmt) } if !reflect.DeepEqual(gotNames, w.wantNames) { - return errors.Errorf("got = %v, want %v", gotNames, w.wantNames) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotNames, w.wantNames) } return nil } @@ -989,7 +989,7 @@ func TestDelete(t *testing.T) { } defaultCheckFunc := func(w want, got *DeleteBuilder) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1063,7 +1063,7 @@ func TestInsert(t *testing.T) { } defaultCheckFunc := func(w want, got *InsertBuilder) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1136,7 +1136,7 @@ func TestUpdate(t *testing.T) { } defaultCheckFunc := func(w want, got *UpdateBuilder) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1203,7 +1203,7 @@ func TestBatch(t *testing.T) { } defaultCheckFunc := func(w want, got *BatchBuilder) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1268,7 +1268,7 @@ func TestEq(t *testing.T) { } defaultCheckFunc := func(w want, got Cmp) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1339,7 +1339,7 @@ func TestIn(t *testing.T) { } defaultCheckFunc := func(w want, got Cmp) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1410,7 +1410,7 @@ func TestContains(t *testing.T) { } defaultCheckFunc := func(w want, got Cmp) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1482,7 +1482,7 @@ func TestWrapErrorWithKeys(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/db/nosql/cassandra/conviction_test.go b/internal/db/nosql/cassandra/conviction_test.go index 06e26389a9f..59203b16ca2 100644 --- a/internal/db/nosql/cassandra/conviction_test.go +++ b/internal/db/nosql/cassandra/conviction_test.go @@ -39,7 +39,7 @@ func TestNewConvictionPolicy(t *testing.T) { } defaultCheckFunc := func(w want, got gocql.ConvictionPolicy) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -106,7 +106,7 @@ func Test_convictionPolicy_AddFailure(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/db/nosql/cassandra/option_test.go b/internal/db/nosql/cassandra/option_test.go index b299aa73d0a..dbbe2392c6e 100644 --- a/internal/db/nosql/cassandra/option_test.go +++ b/internal/db/nosql/cassandra/option_test.go @@ -51,10 +51,10 @@ func TestWithHosts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHosts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithCQLVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithCQLVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -390,10 +390,10 @@ func TestWithProtoVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -403,7 +403,7 @@ func TestWithProtoVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -503,10 +503,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -516,7 +516,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -616,10 +616,10 @@ func TestWithConnectTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -629,7 +629,7 @@ func TestWithConnectTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -729,10 +729,10 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -742,7 +742,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -842,10 +842,10 @@ func TestWithKeyspace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -855,7 +855,7 @@ func TestWithKeyspace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -955,10 +955,10 @@ func TestWithNumConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -968,7 +968,7 @@ func TestWithNumConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1068,10 +1068,10 @@ func TestWithConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1081,7 +1081,7 @@ func TestWithConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1181,10 +1181,10 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1194,7 +1194,7 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1294,10 +1294,10 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1307,7 +1307,7 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1407,10 +1407,10 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1420,7 +1420,7 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1520,10 +1520,10 @@ func TestWithAuthProvider(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1533,7 +1533,7 @@ func TestWithAuthProvider(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1633,10 +1633,10 @@ func TestWithRetryPolicyNumRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1646,7 +1646,7 @@ func TestWithRetryPolicyNumRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1746,10 +1746,10 @@ func TestWithRetryPolicyMinDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1759,7 +1759,7 @@ func TestWithRetryPolicyMinDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1859,10 +1859,10 @@ func TestWithRetryPolicyMaxDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1872,7 +1872,7 @@ func TestWithRetryPolicyMaxDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1972,10 +1972,10 @@ func TestWithReconnectionPolicyInitialInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1985,7 +1985,7 @@ func TestWithReconnectionPolicyInitialInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2085,10 +2085,10 @@ func TestWithReconnectionPolicyMaxRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2098,7 +2098,7 @@ func TestWithReconnectionPolicyMaxRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2198,10 +2198,10 @@ func TestWithSocketKeepalive(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2211,7 +2211,7 @@ func TestWithSocketKeepalive(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2311,10 +2311,10 @@ func TestWithMaxPreparedStmts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2324,7 +2324,7 @@ func TestWithMaxPreparedStmts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2424,10 +2424,10 @@ func TestWithMaxRoutingKeyInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2437,7 +2437,7 @@ func TestWithMaxRoutingKeyInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2537,10 +2537,10 @@ func TestWithPageSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2550,7 +2550,7 @@ func TestWithPageSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2650,10 +2650,10 @@ func TestWithSerialConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2663,7 +2663,7 @@ func TestWithSerialConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2763,10 +2763,10 @@ func TestWithTLS(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2776,7 +2776,7 @@ func TestWithTLS(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2876,10 +2876,10 @@ func TestWithTLSCertPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2889,7 +2889,7 @@ func TestWithTLSCertPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2989,10 +2989,10 @@ func TestWithTLSKeyPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3002,7 +3002,7 @@ func TestWithTLSKeyPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3102,10 +3102,10 @@ func TestWithTLSCAPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3115,7 +3115,7 @@ func TestWithTLSCAPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3215,10 +3215,10 @@ func TestWithEnableHostVerification(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3228,7 +3228,7 @@ func TestWithEnableHostVerification(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3328,10 +3328,10 @@ func TestWithDefaultTimestamp(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3341,7 +3341,7 @@ func TestWithDefaultTimestamp(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3441,10 +3441,10 @@ func TestWithDC(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3454,7 +3454,7 @@ func TestWithDC(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3554,10 +3554,10 @@ func TestWithDCAwareRouting(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3567,7 +3567,7 @@ func TestWithDCAwareRouting(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3667,10 +3667,10 @@ func TestWithNonLocalReplicasFallback(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3680,7 +3680,7 @@ func TestWithNonLocalReplicasFallback(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3780,10 +3780,10 @@ func TestWithShuffleReplicas(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3793,7 +3793,7 @@ func TestWithShuffleReplicas(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -3893,10 +3893,10 @@ func TestWithMaxWaitSchemaAgreement(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -3906,7 +3906,7 @@ func TestWithMaxWaitSchemaAgreement(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4006,10 +4006,10 @@ func TestWithReconnectInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4019,7 +4019,7 @@ func TestWithReconnectInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4119,10 +4119,10 @@ func TestWithIgnorePeerAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4132,7 +4132,7 @@ func TestWithIgnorePeerAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4232,10 +4232,10 @@ func TestWithDisableInitialHostLookup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4245,7 +4245,7 @@ func TestWithDisableInitialHostLookup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4345,10 +4345,10 @@ func TestWithDisableNodeStatusEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4358,7 +4358,7 @@ func TestWithDisableNodeStatusEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4458,10 +4458,10 @@ func TestWithDisableTopologyEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4471,7 +4471,7 @@ func TestWithDisableTopologyEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4571,10 +4571,10 @@ func TestWithDisableSchemaEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4584,7 +4584,7 @@ func TestWithDisableSchemaEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4684,10 +4684,10 @@ func TestWithDisableSkipMetadata(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4697,7 +4697,7 @@ func TestWithDisableSkipMetadata(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4797,10 +4797,10 @@ func TestWithDefaultIdempotence(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4810,7 +4810,7 @@ func TestWithDefaultIdempotence(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -4910,10 +4910,10 @@ func TestWithWriteCoalesceWaitTime(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -4923,7 +4923,7 @@ func TestWithWriteCoalesceWaitTime(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -5023,10 +5023,10 @@ func TestWithTokenAwareHostPolicy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -5036,7 +5036,7 @@ func TestWithTokenAwareHostPolicy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -5136,10 +5136,10 @@ func TestWithHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -5149,7 +5149,7 @@ func TestWithHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -5249,10 +5249,10 @@ func TestWithDCHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -5262,7 +5262,7 @@ func TestWithDCHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -5362,10 +5362,10 @@ func TestWithWhiteListHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -5375,7 +5375,7 @@ func TestWithWhiteListHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/db/rdb/mysql/model_test.go b/internal/db/rdb/mysql/model_test.go index 39f05ed1863..a34efcf8200 100644 --- a/internal/db/rdb/mysql/model_test.go +++ b/internal/db/rdb/mysql/model_test.go @@ -43,7 +43,7 @@ func Test_metaVector_GetUUID(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -114,7 +114,7 @@ func Test_metaVector_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -185,7 +185,7 @@ func Test_metaVector_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -256,7 +256,7 @@ func Test_metaVector_GetIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/db/rdb/mysql/mysql_test.go b/internal/db/rdb/mysql/mysql_test.go index 8d9ed039e92..852319ff51b 100644 --- a/internal/db/rdb/mysql/mysql_test.go +++ b/internal/db/rdb/mysql/mysql_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got MySQL, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -145,7 +145,7 @@ func Test_mySQLClient_Open(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -301,7 +301,7 @@ func Test_mySQLClient_Ping(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -457,7 +457,7 @@ func Test_mySQLClient_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -615,10 +615,10 @@ func Test_mySQLClient_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -778,10 +778,10 @@ func Test_mySQLClient_GetIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -917,7 +917,7 @@ func Test_validateMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1011,7 +1011,7 @@ func Test_mySQLClient_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1170,7 +1170,7 @@ func Test_mySQLClient_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1308,7 +1308,7 @@ func Test_deleteMetaWithTx(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1406,7 +1406,7 @@ func Test_mySQLClient_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1565,7 +1565,7 @@ func Test_mySQLClient_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1725,7 +1725,7 @@ func Test_mySQLClient_SetIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1886,7 +1886,7 @@ func Test_mySQLClient_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/db/rdb/mysql/option_test.go b/internal/db/rdb/mysql/option_test.go index 490aae6b9bf..c8d23f53b31 100644 --- a/internal/db/rdb/mysql/option_test.go +++ b/internal/db/rdb/mysql/option_test.go @@ -56,10 +56,10 @@ func TestWithTimezone(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -126,10 +126,10 @@ func TestWithCharset(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -197,10 +197,10 @@ func TestWithDB(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -268,10 +268,10 @@ func TestWithHost(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -339,10 +339,10 @@ func TestWithPort(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -410,10 +410,10 @@ func TestWithUser(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -484,10 +484,10 @@ func TestWithPass(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -555,10 +555,10 @@ func TestWithName(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -626,10 +626,10 @@ func TestWithInitialPingTimeLimit(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -708,10 +708,10 @@ func TestWithInitialPingDuration(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -790,10 +790,10 @@ func TestWithConnectionLifeTimeLimit(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -872,10 +872,10 @@ func TestWithMaxIdleConns(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -943,10 +943,10 @@ func TestWithMaxOpenConns(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1014,10 +1014,10 @@ func TestWithTLSConfig(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1090,7 +1090,7 @@ func TestWithDialerFunc(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.dialerFunc).Pointer() != reflect.ValueOf(obj.dialerFunc).Pointer() { return errors.Errorf("got dialerFunc = %p, want %p", obj.dialerFunc, w.obj.dialerFunc) @@ -1168,10 +1168,10 @@ func TestWithDialer(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1246,10 +1246,10 @@ func TestWithEventReceiver(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/db/storage/blob/s3/option_test.go b/internal/db/storage/blob/s3/option_test.go index 20490d561de..91803468afc 100644 --- a/internal/db/storage/blob/s3/option_test.go +++ b/internal/db/storage/blob/s3/option_test.go @@ -56,10 +56,10 @@ func TestWithErrGroup(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -138,10 +138,10 @@ func TestWithSession(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -220,10 +220,10 @@ func TestWithBucket(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -295,10 +295,10 @@ func TestWithMaxPartSize(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -389,10 +389,10 @@ func TestWithMaxChunkSize(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -485,10 +485,10 @@ func TestWithReaderBackoff(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -554,7 +554,7 @@ func TestWithReaderBackoffOpts(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } opts := []cmp.Option{ @@ -568,7 +568,7 @@ func TestWithReaderBackoffOpts(t *testing.T) { }), } if diff := cmp.Diff(w.obj, obj, opts...); diff != "" { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil diff --git a/internal/db/storage/blob/s3/reader/option_test.go b/internal/db/storage/blob/s3/reader/option_test.go index fde22221f4c..b7805b383b6 100644 --- a/internal/db/storage/blob/s3/reader/option_test.go +++ b/internal/db/storage/blob/s3/reader/option_test.go @@ -54,7 +54,7 @@ func TestWithErrGroup(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -120,7 +120,7 @@ func TestWithService(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -187,7 +187,7 @@ func TestWithBucket(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -253,7 +253,7 @@ func TestWithKey(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -318,7 +318,7 @@ func TestWithMaxChunkSize(t *testing.T) { } defaultCheckFunc := func(w want, got *T) error { if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } @@ -394,7 +394,7 @@ func TestWithBackoff(t *testing.T) { } defaultCheckFunc := func(w want, got *T) error { if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } @@ -471,7 +471,7 @@ func TestWithBackoffOpts(t *testing.T) { }), } if diff := cmp.Diff(w.obj, got, opts...); diff != "" { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } diff --git a/internal/db/storage/blob/s3/reader/reader_test.go b/internal/db/storage/blob/s3/reader/reader_test.go index 5c88ae09ee2..9ebf926d592 100644 --- a/internal/db/storage/blob/s3/reader/reader_test.go +++ b/internal/db/storage/blob/s3/reader/reader_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Reader) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -126,7 +126,7 @@ func Test_reader_Open(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -226,7 +226,7 @@ func Test_reader_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -325,10 +325,10 @@ func Test_reader_Read(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } diff --git a/internal/db/storage/blob/s3/s3_test.go b/internal/db/storage/blob/s3/s3_test.go index 658011277d9..8bc324b81c5 100644 --- a/internal/db/storage/blob/s3/s3_test.go +++ b/internal/db/storage/blob/s3/s3_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got blob.Bucket, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -130,7 +130,7 @@ func Test_client_Open(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -226,7 +226,7 @@ func Test_client_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -322,10 +322,10 @@ func Test_client_Reader(t *testing.T) { } defaultCheckFunc := func(w want, got io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -429,10 +429,10 @@ func Test_client_Writer(t *testing.T) { } defaultCheckFunc := func(w want, got io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/db/storage/blob/s3/session/option_test.go b/internal/db/storage/blob/s3/session/option_test.go index 763cd34fbc2..8fac4df55ba 100644 --- a/internal/db/storage/blob/s3/session/option_test.go +++ b/internal/db/storage/blob/s3/session/option_test.go @@ -49,10 +49,10 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -163,10 +163,10 @@ func TestWithRegion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithRegion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -277,10 +277,10 @@ func TestWithAccessKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithAccessKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -391,10 +391,10 @@ func TestWithSecretAccessKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithSecretAccessKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -505,10 +505,10 @@ func TestWithToken(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -518,7 +518,7 @@ func TestWithToken(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -619,10 +619,10 @@ func TestWithMaxRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithMaxRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -733,10 +733,10 @@ func TestWithForcePathStyle(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -746,7 +746,7 @@ func TestWithForcePathStyle(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -847,10 +847,10 @@ func TestWithUseAccelerate(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -860,7 +860,7 @@ func TestWithUseAccelerate(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -961,10 +961,10 @@ func TestWithUseARNRegion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -974,7 +974,7 @@ func TestWithUseARNRegion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1075,10 +1075,10 @@ func TestWithUseDualStack(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1088,7 +1088,7 @@ func TestWithUseDualStack(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1189,10 +1189,10 @@ func TestWithEnableSSL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1202,7 +1202,7 @@ func TestWithEnableSSL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1303,10 +1303,10 @@ func TestWithEnableParamValidation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1316,7 +1316,7 @@ func TestWithEnableParamValidation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1417,10 +1417,10 @@ func TestWithEnable100Continue(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1430,7 +1430,7 @@ func TestWithEnable100Continue(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1531,10 +1531,10 @@ func TestWithEnableContentMD5Validation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1544,7 +1544,7 @@ func TestWithEnableContentMD5Validation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1645,10 +1645,10 @@ func TestWithEnableEndpointDiscovery(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1658,7 +1658,7 @@ func TestWithEnableEndpointDiscovery(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1759,10 +1759,10 @@ func TestWithEnableEndpointHostPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1772,7 +1772,7 @@ func TestWithEnableEndpointHostPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1873,10 +1873,10 @@ func TestWithHTTPClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1886,7 +1886,7 @@ func TestWithHTTPClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/db/storage/blob/s3/session/session_test.go b/internal/db/storage/blob/s3/session/session_test.go index 62ab46020b5..a92d6ae76bf 100644 --- a/internal/db/storage/blob/s3/session/session_test.go +++ b/internal/db/storage/blob/s3/session/session_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Session) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func Test_sess_Session(t *testing.T) { } defaultCheckFunc := func(w want, got *session.Session, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/db/storage/blob/s3/writer/option_test.go b/internal/db/storage/blob/s3/writer/option_test.go index a8e071340e8..80916913f30 100644 --- a/internal/db/storage/blob/s3/writer/option_test.go +++ b/internal/db/storage/blob/s3/writer/option_test.go @@ -57,10 +57,10 @@ func TestWithErrGroup(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -143,10 +143,10 @@ func TestWithService(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -232,10 +232,10 @@ func TestWithBucket(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -307,10 +307,10 @@ func TestWithKey(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -382,10 +382,10 @@ func TestWithMaxPartSize(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -457,10 +457,10 @@ func TestWithContentType(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/db/storage/blob/s3/writer/writer_test.go b/internal/db/storage/blob/s3/writer/writer_test.go index d35f97b6d9b..0b796730f36 100644 --- a/internal/db/storage/blob/s3/writer/writer_test.go +++ b/internal/db/storage/blob/s3/writer/writer_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Writer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -127,7 +127,7 @@ func Test_writer_Open(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -231,7 +231,7 @@ func Test_writer_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -334,10 +334,10 @@ func Test_writer_Write(t *testing.T) { } defaultCheckFunc := func(w want, gotN int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotN, w.wantN) { - return errors.Errorf("got = %v, want %v", gotN, w.wantN) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotN, w.wantN) } return nil } @@ -446,7 +446,7 @@ func Test_writer_upload(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/encoding/json/json_test.go b/internal/encoding/json/json_test.go index 92c2ce8cfb7..048533ba297 100644 --- a/internal/encoding/json/json_test.go +++ b/internal/encoding/json/json_test.go @@ -249,7 +249,7 @@ func TestUnmarshal(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -323,10 +323,10 @@ func TestMarshal(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/errgroup/group_test.go b/internal/errgroup/group_test.go index 6e3cc2aff7d..851128c8497 100644 --- a/internal/errgroup/group_test.go +++ b/internal/errgroup/group_test.go @@ -51,10 +51,10 @@ func TestNew(t *testing.T) { if got, want := got.(*group), w.want.(*group); !reflect.DeepEqual(got.emap, want.emap) && !reflect.DeepEqual(got.enableLimitation, want.enableLimitation) && got.cancel != nil { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -122,7 +122,7 @@ func TestInit(t *testing.T) { } defaultCheckFunc := func(w want, gotEgctx context.Context) error { if !reflect.DeepEqual(gotEgctx, w.wantEgctx) { - return errors.Errorf("got = %v, want %v", gotEgctx, w.wantEgctx) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotEgctx, w.wantEgctx) } if instance == nil { return errors.New("instance is nil") @@ -189,7 +189,7 @@ func TestGet(t *testing.T) { } defaultCheckFunc := func(w want, got Group) error { if got, want := got.(*group), w.want.(*group); !reflect.DeepEqual(got.egctx, want.egctx) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -349,10 +349,10 @@ func Test_group_Limitation(t *testing.T) { defaultCheckFunc := func(w want, g Group) error { got, want := g.(*group), w.want.(*group) if !reflect.DeepEqual(got.enableLimitation, want.enableLimitation) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if got.limitation != nil && want.limitation != nil { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -641,7 +641,7 @@ func TestWait(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -697,7 +697,7 @@ func Test_group_Wait(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/errors/blob_test.go b/internal/errors/blob_test.go index 8217c192b0d..57b1112c993 100644 --- a/internal/errors/blob_test.go +++ b/internal/errors/blob_test.go @@ -41,7 +41,7 @@ func TestErrBlobNoSuchBucket_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -115,7 +115,7 @@ func TestIsErrBlobNoSuchBucket(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -186,7 +186,7 @@ func TestErrBlobNoSuchKey_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -260,7 +260,7 @@ func TestIsErrBlobNoSuchKey(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/errors/cassandra_test.go b/internal/errors/cassandra_test.go index 3c0edeb23bc..e16e2e42da0 100644 --- a/internal/errors/cassandra_test.go +++ b/internal/errors/cassandra_test.go @@ -39,7 +39,7 @@ func TestErrCassandraNotFoundIdentity_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -112,7 +112,7 @@ func TestIsErrCassandraNotFound(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -182,7 +182,7 @@ func TestErrCassandraUnavailableIdentity_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -255,7 +255,7 @@ func TestIsErrCassandraUnavailable(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/errors/errors.go b/internal/errors/errors.go index 04f1322a2da..01324b73e07 100644 --- a/internal/errors/errors.go +++ b/internal/errors/errors.go @@ -105,6 +105,28 @@ var ( return nil } + Is = func(err, target error) bool { + if target == nil { + return err == target + } + + isComparable := reflect.TypeOf(target).Comparable() + for { + if isComparable && err == target { + return true + } + if x, ok := err.(interface{ + Is(error) bool + error + }); ok && (x.Error() == target.Error() || x.Is(target)) { + return true + } + if err = Unwrap(err); err == nil { + return false + } + } + } + As = errors.As - Is = errors.Is + // Is = errors.Is ) diff --git a/internal/errors/mysql_test.go b/internal/errors/mysql_test.go index 0ae3d6043df..13616ce774c 100644 --- a/internal/errors/mysql_test.go +++ b/internal/errors/mysql_test.go @@ -39,7 +39,7 @@ func TestErrMySQLNotFoundIdentity_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -112,7 +112,7 @@ func TestIsErrMySQLNotFound(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -182,7 +182,7 @@ func TestErrMySQLInvalidArgumentIdentity_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -255,7 +255,7 @@ func TestIsErrMySQLInvalidArgument(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/errors/redis_test.go b/internal/errors/redis_test.go index 18a0e12b30f..fcb24dbded1 100644 --- a/internal/errors/redis_test.go +++ b/internal/errors/redis_test.go @@ -39,7 +39,7 @@ func TestErrRedisNotFoundIdentity_Error(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -112,7 +112,7 @@ func TestIsErrRedisNotFound(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return Errorf("got = %v, want %v", got, w.want) + return Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/file/file_test.go b/internal/file/file_test.go index 76a24732fb8..c8823b161ba 100644 --- a/internal/file/file_test.go +++ b/internal/file/file_test.go @@ -46,7 +46,7 @@ func TestOpen(t *testing.T) { defaultCheckFunc := func(w want, got *os.File, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if w.want == nil { diff --git a/internal/file/watch/option_test.go b/internal/file/watch/option_test.go index da97533902b..4a747467beb 100644 --- a/internal/file/watch/option_test.go +++ b/internal/file/watch/option_test.go @@ -46,10 +46,10 @@ func TestWithErrGroup(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -122,10 +122,10 @@ func TestWithDirs(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -224,10 +224,10 @@ func TestWithOnChange(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onChange).Pointer() != reflect.ValueOf(obj.onChange).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -301,10 +301,10 @@ func TestWithOnCreate(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onCreate).Pointer() != reflect.ValueOf(obj.onCreate).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -378,10 +378,10 @@ func TestWithOnChmod(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onChmod).Pointer() != reflect.ValueOf(obj.onChmod).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -455,10 +455,10 @@ func TestWithOnRename(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onRename).Pointer() != reflect.ValueOf(obj.onRename).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -532,10 +532,10 @@ func TestWithOnDelete(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onDelete).Pointer() != reflect.ValueOf(obj.onDelete).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -609,10 +609,10 @@ func TestWithOnWrite(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onWrite).Pointer() != reflect.ValueOf(obj.onWrite).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -686,10 +686,10 @@ func TestWithOnError(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.obj.onError).Pointer() != reflect.ValueOf(obj.onError).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/file/watch/watch_test.go b/internal/file/watch/watch_test.go index d7f80f23b43..e0a82a7204f 100644 --- a/internal/file/watch/watch_test.go +++ b/internal/file/watch/watch_test.go @@ -67,10 +67,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Watcher, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -87,7 +87,7 @@ func TestNew(t *testing.T) { }, checkFunc: func(w want, got Watcher, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got == nil { return errors.Errorf("got is nil") @@ -144,10 +144,10 @@ func Test_watch_init(t *testing.T) { } defaultCheckFunc := func(w want, got *watch, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -204,7 +204,7 @@ func Test_watch_init(t *testing.T) { }, checkFunc: func(w want, got *watch, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got == nil { return errors.New("got is nil") @@ -230,7 +230,7 @@ func Test_watch_init(t *testing.T) { }, checkFunc: func(w want, got *watch, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got == nil { return errors.New("got is nil") @@ -302,11 +302,11 @@ func Test_watch_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !errors.Is(<-got, <-w.want) { - return errors.Errorf("errCh got = %v, want %v", got, w.want) + return errors.Errorf("errCh got: \"%v\",\twant: \"%v\"", got, w.want) } return nil @@ -379,13 +379,13 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onChange: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onChange name got = %s, want %s", got, want) + t.Errorf("onChange name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err1") }, onWrite: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err2") }, @@ -432,7 +432,7 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onWrite: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err") }, @@ -478,7 +478,7 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onCreate: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err") }, @@ -524,7 +524,7 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onDelete: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err") }, @@ -570,7 +570,7 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onChmod: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err") }, @@ -616,7 +616,7 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onRename: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err") }, @@ -667,13 +667,13 @@ func Test_watch_Start(t *testing.T) { eg: errgroup.Get(), onWrite: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onWrite name got = %s, want %s", got, want) + t.Errorf("onWrite name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err1") }, onRename: func(ctx context.Context, name string) error { if got, want := name, "watch.go"; got != want { - t.Errorf("onRename name got = %s, want %s", got, want) + t.Errorf("onRename name got: \"%v\",\twant: \"%v\"", got, want) } return errors.New("err2") }, @@ -755,7 +755,7 @@ func Test_watch_Add(t *testing.T) { } defaultCheckFunc := func(w want, got *watch, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got, want := len(got.dirs), len(w.want.dirs); got != want { diff --git a/internal/info/info_test.go b/internal/info/info_test.go index d680bbba067..0ce8fae8304 100644 --- a/internal/info/info_test.go +++ b/internal/info/info_test.go @@ -41,7 +41,7 @@ func TestString(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -101,7 +101,7 @@ func TestGet(t *testing.T) { } defaultCheckFunc := func(w want, got Detail) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -176,7 +176,7 @@ func TestDetail_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -293,7 +293,7 @@ func TestDetail_Get(t *testing.T) { } defaultCheckFunc := func(w want, got Detail) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/k8s/metrics/node/node_test.go b/internal/k8s/metrics/node/node_test.go index 0308df85cbd..5464dcc9ebe 100644 --- a/internal/k8s/metrics/node/node_test.go +++ b/internal/k8s/metrics/node/node_test.go @@ -49,7 +49,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got NodeWatcher) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func Test_reconciler_Reconcile(t *testing.T) { } defaultCheckFunc := func(w want, gotRes reconcile.Result, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -228,7 +228,7 @@ func Test_reconciler_GetName(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -323,7 +323,7 @@ func Test_reconciler_NewReconciler(t *testing.T) { } defaultCheckFunc := func(w want, got reconcile.Reconciler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -421,7 +421,7 @@ func Test_reconciler_For(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -511,7 +511,7 @@ func Test_reconciler_Owns(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -602,10 +602,10 @@ func Test_reconciler_Watches(t *testing.T) { } defaultCheckFunc := func(w want, got *source.Kind, got1 handler.EventHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } diff --git a/internal/k8s/metrics/node/option_test.go b/internal/k8s/metrics/node/option_test.go index b9a69a991c6..3c65f92c097 100644 --- a/internal/k8s/metrics/node/option_test.go +++ b/internal/k8s/metrics/node/option_test.go @@ -50,10 +50,10 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/k8s/metrics/pod/option_test.go b/internal/k8s/metrics/pod/option_test.go index 39d3f42835a..57d8c1ded91 100644 --- a/internal/k8s/metrics/pod/option_test.go +++ b/internal/k8s/metrics/pod/option_test.go @@ -50,10 +50,10 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/k8s/metrics/pod/pod_test.go b/internal/k8s/metrics/pod/pod_test.go index e0e78962b23..922891bec97 100644 --- a/internal/k8s/metrics/pod/pod_test.go +++ b/internal/k8s/metrics/pod/pod_test.go @@ -49,7 +49,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got PodWatcher) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func Test_reconciler_Reconcile(t *testing.T) { } defaultCheckFunc := func(w want, gotRes reconcile.Result, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -228,7 +228,7 @@ func Test_reconciler_GetName(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -323,7 +323,7 @@ func Test_reconciler_NewReconciler(t *testing.T) { } defaultCheckFunc := func(w want, got reconcile.Reconciler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -421,7 +421,7 @@ func Test_reconciler_For(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -511,7 +511,7 @@ func Test_reconciler_Owns(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -602,10 +602,10 @@ func Test_reconciler_Watches(t *testing.T) { } defaultCheckFunc := func(w want, got *source.Kind, got1 handler.EventHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } diff --git a/internal/k8s/node/node_test.go b/internal/k8s/node/node_test.go index cb843f6f41a..faabb78c468 100644 --- a/internal/k8s/node/node_test.go +++ b/internal/k8s/node/node_test.go @@ -50,7 +50,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got NodeWatcher) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -131,10 +131,10 @@ func Test_reconciler_Reconcile(t *testing.T) { } defaultCheckFunc := func(w want, gotRes reconcile.Result, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -234,7 +234,7 @@ func Test_reconciler_GetName(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -333,7 +333,7 @@ func Test_reconciler_NewReconciler(t *testing.T) { } defaultCheckFunc := func(w want, got reconcile.Reconciler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -435,7 +435,7 @@ func Test_reconciler_For(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -529,7 +529,7 @@ func Test_reconciler_Owns(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -624,10 +624,10 @@ func Test_reconciler_Watches(t *testing.T) { } defaultCheckFunc := func(w want, got *source.Kind, got1 handler.EventHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } diff --git a/internal/k8s/node/option_test.go b/internal/k8s/node/option_test.go index 76f176c5158..153d5e256b9 100644 --- a/internal/k8s/node/option_test.go +++ b/internal/k8s/node/option_test.go @@ -50,10 +50,10 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/k8s/option_test.go b/internal/k8s/option_test.go index 9bc145ec91a..815cbe2f0ed 100644 --- a/internal/k8s/option_test.go +++ b/internal/k8s/option_test.go @@ -51,10 +51,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithResourceController(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithResourceController(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -390,10 +390,10 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -403,7 +403,7 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -503,10 +503,10 @@ func TestWithMetricsAddress(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -516,7 +516,7 @@ func TestWithMetricsAddress(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -612,10 +612,10 @@ func TestWithEnableLeaderElection(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -625,7 +625,7 @@ func TestWithEnableLeaderElection(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -715,10 +715,10 @@ func TestWithDisableLeaderElection(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -728,7 +728,7 @@ func TestWithDisableLeaderElection(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/k8s/pod/option_test.go b/internal/k8s/pod/option_test.go index 525019b3758..a6a4d8c9586 100644 --- a/internal/k8s/pod/option_test.go +++ b/internal/k8s/pod/option_test.go @@ -50,10 +50,10 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithManager(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithOnReconcileFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/k8s/pod/pod_test.go b/internal/k8s/pod/pod_test.go index abf22841d7b..57d7e15c1cf 100644 --- a/internal/k8s/pod/pod_test.go +++ b/internal/k8s/pod/pod_test.go @@ -49,7 +49,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got PodWatcher) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -130,10 +130,10 @@ func Test_reconciler_Reconcile(t *testing.T) { } defaultCheckFunc := func(w want, gotRes reconcile.Result, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -233,7 +233,7 @@ func Test_reconciler_GetName(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -332,7 +332,7 @@ func Test_reconciler_NewReconciler(t *testing.T) { } defaultCheckFunc := func(w want, got reconcile.Reconciler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -434,7 +434,7 @@ func Test_reconciler_For(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -528,7 +528,7 @@ func Test_reconciler_Owns(t *testing.T) { } defaultCheckFunc := func(w want, got runtime.Object) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -623,10 +623,10 @@ func Test_reconciler_Watches(t *testing.T) { } defaultCheckFunc := func(w want, got *source.Kind, got1 handler.EventHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } diff --git a/internal/k8s/reconciler_test.go b/internal/k8s/reconciler_test.go index dcc40fd0012..48dd0cdd8fe 100644 --- a/internal/k8s/reconciler_test.go +++ b/internal/k8s/reconciler_test.go @@ -47,10 +47,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotCl Controller, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCl, w.wantCl) { - return errors.Errorf("got = %v, want %v", gotCl, w.wantCl) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCl, w.wantCl) } return nil } @@ -131,10 +131,10 @@ func Test_controller_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/log/format/format_test.go b/internal/log/format/format_test.go index c4de04c64cb..9397b7589b0 100644 --- a/internal/log/format/format_test.go +++ b/internal/log/format/format_test.go @@ -37,7 +37,7 @@ func TestFormat_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -111,7 +111,7 @@ func TestAtof(t *testing.T) { } defaultCheckFunc := func(w want, got Format) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/log/glg/glg_test.go b/internal/log/glg/glg_test.go index dd5a06f266e..309d4e94853 100644 --- a/internal/log/glg/glg_test.go +++ b/internal/log/glg/glg_test.go @@ -937,7 +937,7 @@ func Test_logger_setLevelMode(t *testing.T) { } defaultCheckFunc := func(w want, got *logger) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1033,7 +1033,7 @@ func Test_logger_setLogFormat(t *testing.T) { } defaultCheckFunc := func(w want, got *logger) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/log/level/level_test.go b/internal/log/level/level_test.go index 626417c5ef5..d0c3bc4032f 100644 --- a/internal/log/level/level_test.go +++ b/internal/log/level/level_test.go @@ -38,7 +38,7 @@ func TestAtol(t *testing.T) { defaultCheckFunc := func(w want, got Level) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -214,7 +214,7 @@ func TestLevel_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/log/log_test.go b/internal/log/log_test.go index 8c60ff3cfd6..e7a4ceba139 100644 --- a/internal/log/log_test.go +++ b/internal/log/log_test.go @@ -53,7 +53,7 @@ func TestInit(t *testing.T) { } defaultCheckFunc := func(w want, got Logger) error { if !reflect.DeepEqual(got, l) { - return errors.Errorf("got = %v, want %v", got, w.l) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.l) } return nil } @@ -130,7 +130,7 @@ func Test_getLogger(t *testing.T) { } defaultCheckFunc := func(w want, got Logger) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -200,7 +200,7 @@ func TestBold(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -282,7 +282,7 @@ func TestDebug(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(got, w.vals) { - return errors.Errorf("got = %v, want %v", got, w.vals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.vals) } return nil }, @@ -360,10 +360,10 @@ func TestDebugf(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(gotFormat, w.format) { - return errors.Errorf("format got = %v, want %v", gotFormat, w.format) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotFormat, w.format) } if !reflect.DeepEqual(gotVals, w.vals) { - return errors.Errorf("format got = %v, want %v", gotVals, w.vals) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotVals, w.vals) } return nil }, @@ -434,7 +434,7 @@ func TestInfo(t *testing.T) { }, checkFunc: func(want) error { if !reflect.DeepEqual(got, w.vals) { - return errors.Errorf("got = %v, want %v", got, w.vals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.vals) } return nil }, @@ -512,10 +512,10 @@ func TestInfof(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(gotFormat, w.format) { - return errors.Errorf("format got = %v, want %v", gotFormat, w.format) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotFormat, w.format) } if !reflect.DeepEqual(gotVals, w.vals) { - return errors.Errorf("format got = %v, want %v", gotVals, w.vals) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotVals, w.vals) } return nil }, @@ -586,7 +586,7 @@ func TestWarn(t *testing.T) { }, checkFunc: func(want) error { if !reflect.DeepEqual(got, w.vals) { - return errors.Errorf("got = %v, want %v", got, w.vals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.vals) } return nil }, @@ -664,10 +664,10 @@ func TestWarnf(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(gotFormat, w.format) { - return errors.Errorf("format got = %v, want %v", gotFormat, w.format) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotFormat, w.format) } if !reflect.DeepEqual(gotVals, w.vals) { - return errors.Errorf("format got = %v, want %v", gotVals, w.vals) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotVals, w.vals) } return nil }, @@ -738,7 +738,7 @@ func TestError(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(got, w.vals) { - return errors.Errorf("got = %v, want %v", got, w.vals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.vals) } return nil }, @@ -816,10 +816,10 @@ func TestErrorf(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(gotFormat, w.format) { - return errors.Errorf("format got = %v, want %v", gotFormat, w.format) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotFormat, w.format) } if !reflect.DeepEqual(gotVals, w.vals) { - return errors.Errorf("format got = %v, want %v", gotVals, w.vals) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotVals, w.vals) } return nil }, @@ -890,7 +890,7 @@ func TestFatal(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(got, w.vals) { - return errors.Errorf("got = %v, want %v", got, w.vals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.vals) } return nil }, @@ -968,10 +968,10 @@ func TestFatalf(t *testing.T) { }, checkFunc: func(w want) error { if !reflect.DeepEqual(gotFormat, w.format) { - return errors.Errorf("format got = %v, want %v", gotFormat, w.format) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotFormat, w.format) } if !reflect.DeepEqual(gotVals, w.vals) { - return errors.Errorf("format got = %v, want %v", gotVals, w.vals) + return errors.Errorf("format got: \"%v\",\twant: \"%v\"", gotVals, w.vals) } return nil }, diff --git a/internal/log/logger/type_test.go b/internal/log/logger/type_test.go index 6243828bc03..15da881b2ab 100644 --- a/internal/log/logger/type_test.go +++ b/internal/log/logger/type_test.go @@ -38,7 +38,7 @@ func TestType_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -131,7 +131,7 @@ func TestAtot(t *testing.T) { } defaultCheckFunc := func(w want, got Type) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/log/option_test.go b/internal/log/option_test.go index b4b6d87d542..8f21759fbe1 100644 --- a/internal/log/option_test.go +++ b/internal/log/option_test.go @@ -46,7 +46,7 @@ func TestWithLogger(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -120,7 +120,7 @@ func TestWithLoggerType(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -197,7 +197,7 @@ func TestWithLevel(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -275,7 +275,7 @@ func TestWithFormat(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/log/retry/option_test.go b/internal/log/retry/option_test.go index 4bfea597253..a7668b27d44 100644 --- a/internal/log/retry/option_test.go +++ b/internal/log/retry/option_test.go @@ -43,7 +43,7 @@ func TestWithError(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if reflect.ValueOf(w.obj.errorFn).Pointer() != reflect.ValueOf(obj.errorFn).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -115,7 +115,7 @@ func TestWithWarn(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if reflect.ValueOf(w.obj.warnFn).Pointer() != reflect.ValueOf(obj.warnFn).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/log/retry/retry_test.go b/internal/log/retry/retry_test.go index cfaeed4a07a..339b76d3361 100644 --- a/internal/log/retry/retry_test.go +++ b/internal/log/retry/retry_test.go @@ -43,11 +43,11 @@ func TestNew(t *testing.T) { wantr, gotr := w.want.(*retry), got.(*retry) if reflect.ValueOf(wantr.errorFn).Pointer() != reflect.ValueOf(gotr.errorFn).Pointer() { - return errors.Errorf("errorFn: got = %v, want %v", gotr, wantr) + return errors.Errorf("errorFn: got: \"%v\",\twant: \"%v\"", gotr, wantr) } if reflect.ValueOf(wantr.warnFn).Pointer() != reflect.ValueOf(gotr.warnFn).Pointer() { - return errors.Errorf("warnFn: got = %v, want %v", gotr, wantr) + return errors.Errorf("warnFn: got: \"%v\",\twant: \"%v\"", gotr, wantr) } return nil diff --git a/internal/net/grpc/client_test.go b/internal/net/grpc/client_test.go index 0b67fe6fc79..27dad9517e3 100644 --- a/internal/net/grpc/client_test.go +++ b/internal/net/grpc/client_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotC Client) error { if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -134,10 +134,10 @@ func Test_gRPCClient_StartConnectionMonitor(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -266,7 +266,7 @@ func Test_gRPCClient_Range(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -398,7 +398,7 @@ func Test_gRPCClient_RangeConcurrent(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -532,7 +532,7 @@ func Test_gRPCClient_OrderedRange(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -667,7 +667,7 @@ func Test_gRPCClient_OrderedRangeConcurrent(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -804,10 +804,10 @@ func Test_gRPCClient_Do(t *testing.T) { } defaultCheckFunc := func(w want, gotData interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotData, w.wantData) { - return errors.Errorf("got = %v, want %v", gotData, w.wantData) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotData, w.wantData) } return nil } @@ -935,7 +935,7 @@ func Test_gRPCClient_GetDialOption(t *testing.T) { } defaultCheckFunc := func(w want, got []DialOption) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1053,7 +1053,7 @@ func Test_gRPCClient_GetCallOption(t *testing.T) { } defaultCheckFunc := func(w want, got []CallOption) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1177,7 +1177,7 @@ func Test_gRPCClient_Connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1309,7 +1309,7 @@ func Test_gRPCClient_Disconnect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1433,7 +1433,7 @@ func Test_gRPCClient_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/grpc/grpcconns_test.go b/internal/net/grpc/grpcconns_test.go index 4b940c51bc0..b9debcfcb7a 100644 --- a/internal/net/grpc/grpcconns_test.go +++ b/internal/net/grpc/grpcconns_test.go @@ -45,7 +45,7 @@ func Test_newEntryGrpcConns(t *testing.T) { } defaultCheckFunc := func(w want, got *entryGrpcConns) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -123,10 +123,10 @@ func Test_grpcConns_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue pool.Conn, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -215,10 +215,10 @@ func Test_entryGrpcConns_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue pool.Conn, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -388,7 +388,7 @@ func Test_entryGrpcConns_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -467,7 +467,7 @@ func Test_entryGrpcConns_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -708,7 +708,7 @@ func Test_entryGrpcConns_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1031,7 +1031,7 @@ func Test_entryGrpcConns_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/internal/net/grpc/interceptor_test.go b/internal/net/grpc/interceptor_test.go index 7ed094565cb..119b89e18fe 100644 --- a/internal/net/grpc/interceptor_test.go +++ b/internal/net/grpc/interceptor_test.go @@ -38,7 +38,7 @@ func TestRecoverInterceptor(t *testing.T) { } defaultCheckFunc := func(w want, got UnaryServerInterceptor) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -99,7 +99,7 @@ func TestRecoverStreamInterceptor(t *testing.T) { } defaultCheckFunc := func(w want, got StreamServerInterceptor) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/metric/client_test.go b/internal/net/grpc/metric/client_test.go index 048740e90f3..e092a98c601 100644 --- a/internal/net/grpc/metric/client_test.go +++ b/internal/net/grpc/metric/client_test.go @@ -41,7 +41,7 @@ func TestNewClientHandler(t *testing.T) { } defaultCheckFunc := func(w want, got *ClientHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/metric/server_test.go b/internal/net/grpc/metric/server_test.go index 724b2a5983c..ad101184b21 100644 --- a/internal/net/grpc/metric/server_test.go +++ b/internal/net/grpc/metric/server_test.go @@ -41,7 +41,7 @@ func TestNewServerHandler(t *testing.T) { } defaultCheckFunc := func(w want, got *ServerHandler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/option_test.go b/internal/net/grpc/option_test.go index e6389766ede..9b26c227462 100644 --- a/internal/net/grpc/option_test.go +++ b/internal/net/grpc/option_test.go @@ -54,10 +54,10 @@ func TestWithAddrs(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -67,7 +67,7 @@ func TestWithAddrs(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -167,10 +167,10 @@ func TestWithHealthCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -180,7 +180,7 @@ func TestWithHealthCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -280,10 +280,10 @@ func TestWithConnectionPoolRebalanceDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -293,7 +293,7 @@ func TestWithConnectionPoolRebalanceDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -393,10 +393,10 @@ func TestWithEnableConnectionPoolRebalance(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -406,7 +406,7 @@ func TestWithEnableConnectionPoolRebalance(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -506,10 +506,10 @@ func TestWithConnectionPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -519,7 +519,7 @@ func TestWithConnectionPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -619,10 +619,10 @@ func TestWithDialOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithDialOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -732,10 +732,10 @@ func TestWithMaxBackoffDelay(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -745,7 +745,7 @@ func TestWithMaxBackoffDelay(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -845,10 +845,10 @@ func TestWithCallOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -858,7 +858,7 @@ func TestWithCallOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -958,10 +958,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -971,7 +971,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1071,10 +1071,10 @@ func TestWithBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1084,7 +1084,7 @@ func TestWithBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1184,10 +1184,10 @@ func TestWithWaitForReady(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1197,7 +1197,7 @@ func TestWithWaitForReady(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1297,10 +1297,10 @@ func TestWithMaxRetryRPCBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1310,7 +1310,7 @@ func TestWithMaxRetryRPCBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1410,10 +1410,10 @@ func TestWithMaxRecvMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1423,7 +1423,7 @@ func TestWithMaxRecvMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1523,10 +1523,10 @@ func TestWithMaxSendMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1536,7 +1536,7 @@ func TestWithMaxSendMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1636,10 +1636,10 @@ func TestWithWriteBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1649,7 +1649,7 @@ func TestWithWriteBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1749,10 +1749,10 @@ func TestWithReadBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1762,7 +1762,7 @@ func TestWithReadBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1862,10 +1862,10 @@ func TestWithInitialWindowSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1875,7 +1875,7 @@ func TestWithInitialWindowSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1975,10 +1975,10 @@ func TestWithInitialConnectionWindowSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1988,7 +1988,7 @@ func TestWithInitialConnectionWindowSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2088,10 +2088,10 @@ func TestWithMaxMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2101,7 +2101,7 @@ func TestWithMaxMsgSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2201,10 +2201,10 @@ func TestWithInsecure(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2214,7 +2214,7 @@ func TestWithInsecure(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2314,10 +2314,10 @@ func TestWithDialTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2327,7 +2327,7 @@ func TestWithDialTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2429,10 +2429,10 @@ func TestWithKeepaliveParams(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2442,7 +2442,7 @@ func TestWithKeepaliveParams(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2546,10 +2546,10 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2559,7 +2559,7 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2659,10 +2659,10 @@ func TestWithTLSConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2672,7 +2672,7 @@ func TestWithTLSConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -2772,10 +2772,10 @@ func TestWithOldConnCloseDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2785,7 +2785,7 @@ func TestWithOldConnCloseDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/net/grpc/pool/option_test.go b/internal/net/grpc/pool/option_test.go index 359567afc75..368d5153dd1 100644 --- a/internal/net/grpc/pool/option_test.go +++ b/internal/net/grpc/pool/option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithStartPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithStartPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -502,10 +502,10 @@ func TestWithEndPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -515,7 +515,7 @@ func TestWithEndPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -615,10 +615,10 @@ func TestWithBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -628,7 +628,7 @@ func TestWithBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -728,10 +728,10 @@ func TestWithSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -741,7 +741,7 @@ func TestWithSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -841,10 +841,10 @@ func TestWithDialOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -854,7 +854,7 @@ func TestWithDialOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -954,10 +954,10 @@ func TestWithDialTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -967,7 +967,7 @@ func TestWithDialTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -1067,10 +1067,10 @@ func TestWithOldConnCloseDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1080,7 +1080,7 @@ func TestWithOldConnCloseDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/net/grpc/pool/pool_test.go b/internal/net/grpc/pool/pool_test.go index 24a5d0163b6..273c8abd6d7 100644 --- a/internal/net/grpc/pool/pool_test.go +++ b/internal/net/grpc/pool/pool_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotC Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -144,10 +144,10 @@ func Test_pool_Connect(t *testing.T) { } defaultCheckFunc := func(w want, gotC Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -288,10 +288,10 @@ func Test_pool_load(t *testing.T) { } defaultCheckFunc := func(w want, gotPc *poolConn, gotOk bool) error { if !reflect.DeepEqual(gotPc, w.wantPc) { - return errors.Errorf("got = %v, want %v", gotPc, w.wantPc) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotPc, w.wantPc) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -432,10 +432,10 @@ func Test_pool_connect(t *testing.T) { } defaultCheckFunc := func(w want, gotC Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -571,7 +571,7 @@ func Test_pool_Disconnect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -707,10 +707,10 @@ func Test_pool_dial(t *testing.T) { } defaultCheckFunc := func(w want, gotConn *ClientConn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotConn, w.wantConn) { - return errors.Errorf("got = %v, want %v", gotConn, w.wantConn) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotConn, w.wantConn) } return nil } @@ -852,7 +852,7 @@ func Test_pool_IsHealthy(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -992,7 +992,7 @@ func Test_pool_Do(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1129,10 +1129,10 @@ func Test_pool_Get(t *testing.T) { } defaultCheckFunc := func(w want, got *ClientConn, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -1267,10 +1267,10 @@ func Test_pool_get(t *testing.T) { } defaultCheckFunc := func(w want, got *ClientConn, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -1406,7 +1406,7 @@ func Test_pool_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1536,7 +1536,7 @@ func Test_pool_Size(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1671,10 +1671,10 @@ func Test_pool_lookupIPAddr(t *testing.T) { } defaultCheckFunc := func(w want, gotIps []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIps, w.wantIps) { - return errors.Errorf("got = %v, want %v", gotIps, w.wantIps) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIps, w.wantIps) } return nil } @@ -1816,10 +1816,10 @@ func Test_pool_Reconnect(t *testing.T) { } defaultCheckFunc := func(w want, gotC Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotC, w.wantC) { - return errors.Errorf("got = %v, want %v", gotC, w.wantC) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotC, w.wantC) } return nil } @@ -1961,7 +1961,7 @@ func Test_pool_scanGRPCPort(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2085,7 +2085,7 @@ func Test_isGRPCPort(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2160,7 +2160,7 @@ func Test_isHealthy(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/proto/proto_test.go b/internal/net/grpc/proto/proto_test.go index 0e00c18d4bd..8c4608b0e60 100644 --- a/internal/net/grpc/proto/proto_test.go +++ b/internal/net/grpc/proto/proto_test.go @@ -41,7 +41,7 @@ func TestClone(t *testing.T) { } defaultCheckFunc := func(w want, got Message) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/status/status_test.go b/internal/net/grpc/status/status_test.go index 33360039878..b9f3ef6ed37 100644 --- a/internal/net/grpc/status/status_test.go +++ b/internal/net/grpc/status/status_test.go @@ -49,7 +49,7 @@ func Test_newStatus(t *testing.T) { } defaultCheckFunc := func(w want, gotSt *status.Status) error { if !reflect.DeepEqual(gotSt, w.wantSt) { - return errors.Errorf("got = %v, want %v", gotSt, w.wantSt) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotSt, w.wantSt) } return nil } @@ -128,7 +128,7 @@ func TestWrapWithCanceled(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -205,7 +205,7 @@ func TestWrapWithUnknown(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -282,7 +282,7 @@ func TestWrapWithInvalidArgument(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -359,7 +359,7 @@ func TestWrapWithDeadlineExceeded(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func TestWrapWithNotFound(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -513,7 +513,7 @@ func TestWrapWithAlreadyExists(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -590,7 +590,7 @@ func TestWrapWithPermissionDenied(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -667,7 +667,7 @@ func TestWrapWithResourceExhausted(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -744,7 +744,7 @@ func TestWrapWithFailedPrecondition(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -821,7 +821,7 @@ func TestWrapWithAborted(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -898,7 +898,7 @@ func TestWrapWithOutOfRange(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -975,7 +975,7 @@ func TestWrapWithUnimplemented(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1052,7 +1052,7 @@ func TestWrapWithInternal(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1129,7 +1129,7 @@ func TestWrapWithUnavailable(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1206,7 +1206,7 @@ func TestWrapWithDataLoss(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1283,7 +1283,7 @@ func TestWrapWithUnauthenticated(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1358,7 +1358,7 @@ func TestFromError(t *testing.T) { } defaultCheckFunc := func(w want, got *gerrors.Errors_RPC) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/grpc/stream_test.go b/internal/net/grpc/stream_test.go index b9329928289..b5c9b1eb552 100644 --- a/internal/net/grpc/stream_test.go +++ b/internal/net/grpc/stream_test.go @@ -48,7 +48,7 @@ func TestBidirectionalStream(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -130,7 +130,7 @@ func TestBidirectionalStreamClient(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/http/client/client_test.go b/internal/net/http/client/client_test.go index e9b55968091..d02111be960 100644 --- a/internal/net/http/client/client_test.go +++ b/internal/net/http/client/client_test.go @@ -43,10 +43,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got *http.Client, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/http/client/option_test.go b/internal/net/http/client/option_test.go index 654ae41f93d..f2130cf1aa3 100644 --- a/internal/net/http/client/option_test.go +++ b/internal/net/http/client/option_test.go @@ -53,10 +53,10 @@ func TestWithProxy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -66,7 +66,7 @@ func TestWithProxy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -167,10 +167,10 @@ func TestWithDialContext(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -180,7 +180,7 @@ func TestWithDialContext(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -281,10 +281,10 @@ func TestWithTLSHandshakeTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -294,7 +294,7 @@ func TestWithTLSHandshakeTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -395,10 +395,10 @@ func TestWithEnableKeepAlives(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -408,7 +408,7 @@ func TestWithEnableKeepAlives(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -509,10 +509,10 @@ func TestWithEnableCompression(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -522,7 +522,7 @@ func TestWithEnableCompression(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -623,10 +623,10 @@ func TestWithMaxIdleConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -636,7 +636,7 @@ func TestWithMaxIdleConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -737,10 +737,10 @@ func TestWithMaxIdleConnsPerHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -750,7 +750,7 @@ func TestWithMaxIdleConnsPerHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -851,10 +851,10 @@ func TestWithMaxConnsPerHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -864,7 +864,7 @@ func TestWithMaxConnsPerHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -965,10 +965,10 @@ func TestWithIdleConnTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -978,7 +978,7 @@ func TestWithIdleConnTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1079,10 +1079,10 @@ func TestWithResponseHeaderTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1092,7 +1092,7 @@ func TestWithResponseHeaderTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1193,10 +1193,10 @@ func TestWithExpectContinueTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1206,7 +1206,7 @@ func TestWithExpectContinueTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1307,10 +1307,10 @@ func TestWithProxyConnectHeader(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1320,7 +1320,7 @@ func TestWithProxyConnectHeader(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1421,10 +1421,10 @@ func TestWithMaxResponseHeaderBytes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1434,7 +1434,7 @@ func TestWithMaxResponseHeaderBytes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1535,10 +1535,10 @@ func TestWithWriteBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1548,7 +1548,7 @@ func TestWithWriteBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1649,10 +1649,10 @@ func TestWithReadBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1662,7 +1662,7 @@ func TestWithReadBufferSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1763,10 +1763,10 @@ func TestWithForceAttemptHTTP2(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1776,7 +1776,7 @@ func TestWithForceAttemptHTTP2(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1877,10 +1877,10 @@ func TestWithBackoffOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1890,7 +1890,7 @@ func TestWithBackoffOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/net/http/json/json_test.go b/internal/net/http/json/json_test.go index 4714fa0aa5d..74b6232c0e1 100644 --- a/internal/net/http/json/json_test.go +++ b/internal/net/http/json/json_test.go @@ -420,7 +420,7 @@ func TestDecodeResponse(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -495,7 +495,7 @@ func TestEncodeRequest(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -574,7 +574,7 @@ func TestRequest(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/http/middleware/timeout_test.go b/internal/net/http/middleware/timeout_test.go index ecdee5adfa4..b7f6afd1f42 100644 --- a/internal/net/http/middleware/timeout_test.go +++ b/internal/net/http/middleware/timeout_test.go @@ -221,7 +221,7 @@ func Test_timeout_Wrap(t *testing.T) { } defaultCheckFunc := func(w want, got rest.Func) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/http/routing/router_test.go b/internal/net/http/routing/router_test.go index e5c075813e6..60033f89c40 100644 --- a/internal/net/http/routing/router_test.go +++ b/internal/net/http/routing/router_test.go @@ -205,7 +205,7 @@ func Test_router_routing(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/http/transport/option_test.go b/internal/net/http/transport/option_test.go index 0d0e6426b72..187bbcf2465 100644 --- a/internal/net/http/transport/option_test.go +++ b/internal/net/http/transport/option_test.go @@ -53,7 +53,7 @@ func TestWithRoundTripper(t *testing.T) { defaultCheckFunc := func(w want, got *T) error { if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } @@ -117,7 +117,7 @@ func TestWithBackoff(t *testing.T) { defaultCheckFunc := func(w want, got *T) error { if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } diff --git a/internal/net/http/transport/roundtrip_test.go b/internal/net/http/transport/roundtrip_test.go index cb2bd5f597e..6e2aae84c36 100644 --- a/internal/net/http/transport/roundtrip_test.go +++ b/internal/net/http/transport/roundtrip_test.go @@ -56,7 +56,7 @@ func TestNewExpBackoff(t *testing.T) { } defaultCheckFunc := func(w want, got http.RoundTripper) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -133,10 +133,10 @@ func Test_ert_RoundTrip(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *http.Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -345,10 +345,10 @@ func Test_ert_roundTrip(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *http.Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -472,7 +472,7 @@ func Test_retryableStatusCode(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/net/net_test.go b/internal/net/net_test.go index d2822a6031e..c00aee76e1c 100644 --- a/internal/net/net_test.go +++ b/internal/net/net_test.go @@ -67,10 +67,10 @@ func TestListen(t *testing.T) { } defaultCheckFunc := func(w want, got Listener, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -83,7 +83,7 @@ func TestListen(t *testing.T) { }, checkFunc: func(w want, got Listener, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return got.Close() @@ -130,7 +130,7 @@ func TestIsLocal(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -223,10 +223,10 @@ func TestDial(t *testing.T) { } defaultCheckFunc := func(w want, gotConn Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotConn, w.wantConn) { - return errors.Errorf("got = %v, want %v", gotConn, w.wantConn) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotConn, w.wantConn) } return nil } @@ -247,7 +247,7 @@ func TestDial(t *testing.T) { }, checkFunc: func(w want, gotConn Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } // read the output from the server and check if it is equals to the count @@ -310,16 +310,16 @@ func TestParse(t *testing.T) { } defaultCheckFunc := func(w want, gotHost string, gotPort uint16, gotIsIP bool, err error) error { if (w.err == nil && err != nil) || (w.err != nil && err == nil) || (err != nil && err.Error() != w.err.Error()) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotHost, w.wantHost) { - return errors.Errorf("got = %v, want %v", gotHost, w.wantHost) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHost, w.wantHost) } if !reflect.DeepEqual(gotPort, w.wantPort) { - return errors.Errorf("got = %v, want %v", gotPort, w.wantPort) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotPort, w.wantPort) } if !reflect.DeepEqual(gotIsIP, w.wantIsIP) { - return errors.Errorf("got = %v, want %v", gotIsIP, w.wantIsIP) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsIP, w.wantIsIP) } return nil } @@ -445,7 +445,7 @@ func TestIsIPv6(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -509,7 +509,7 @@ func TestIsIPv4(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -575,13 +575,13 @@ func TestSplitHostPort(t *testing.T) { } defaultCheckFunc := func(w want, gotHost string, gotPort uint16, err error) error { if (w.err == nil && err != nil) || (w.err != nil && err == nil) || (err != nil && err.Error() != w.err.Error()) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotHost, w.wantHost) { - return errors.Errorf("got = %v, want %v", gotHost, w.wantHost) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHost, w.wantHost) } if !reflect.DeepEqual(gotPort, w.wantPort) { - return errors.Errorf("got = %v, want %v", gotPort, w.wantPort) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotPort, w.wantPort) } return nil } @@ -704,7 +704,7 @@ func TestScanPorts(t *testing.T) { } defaultCheckFunc := func(w want, gotPorts []uint16, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } // count how want want ports exists in got ports @@ -719,7 +719,7 @@ func TestScanPorts(t *testing.T) { } if cnt != len(w.wantPorts) { - return errors.Errorf("got = %v, want %v", gotPorts, w.wantPorts) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotPorts, w.wantPorts) } return nil } diff --git a/internal/net/tcp/control_darwin_test.go b/internal/net/tcp/control_darwin_test.go index 5458a81dd55..f355b470046 100644 --- a/internal/net/tcp/control_darwin_test.go +++ b/internal/net/tcp/control_darwin_test.go @@ -47,7 +47,7 @@ func TestControl(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/tcp/control_other_test.go b/internal/net/tcp/control_other_test.go index 8b2b11001d5..1f6378dd7fb 100644 --- a/internal/net/tcp/control_other_test.go +++ b/internal/net/tcp/control_other_test.go @@ -46,7 +46,7 @@ func TestControl(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/tcp/control_unix_test.go b/internal/net/tcp/control_unix_test.go index 06b689b8bbc..350960cde41 100644 --- a/internal/net/tcp/control_unix_test.go +++ b/internal/net/tcp/control_unix_test.go @@ -47,7 +47,7 @@ func TestControl(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/tcp/control_windows_test.go b/internal/net/tcp/control_windows_test.go index b9b6533eac7..91753797a3d 100644 --- a/internal/net/tcp/control_windows_test.go +++ b/internal/net/tcp/control_windows_test.go @@ -46,7 +46,7 @@ func TestControl(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/net/tcp/dialer_test.go b/internal/net/tcp/dialer_test.go index e6112df5c98..de6c734885f 100644 --- a/internal/net/tcp/dialer_test.go +++ b/internal/net/tcp/dialer_test.go @@ -70,7 +70,7 @@ func Test_dialerCache_IP(t *testing.T) { } defaultCheckFunc := func(d *dialerCache, w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -195,7 +195,7 @@ func Test_dialerCache_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -253,14 +253,14 @@ func TestNewDialer(t *testing.T) { } defaultCheckFunc := func(w want, gotDer Dialer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %+v, want %+v", err, w.err) + return errors.Errorf("got_error: \"%+v\",\twant: \"%+v\"", err, w.err) } if w.wantDer == nil && gotDer == nil { return nil } if w.wantDer == nil && gotDer != nil || w.wantDer != nil && gotDer == nil { - return errors.Errorf("got der: %+v, want der: %+v", gotDer, w.wantDer) + return errors.Errorf("got: \"%+v\",\twant: \"%+v\"", gotDer, w.wantDer) } want := w.wantDer.(*dialer) @@ -426,7 +426,7 @@ func Test_dialer_GetDialer(t *testing.T) { } defaultCheckFunc := func(w want, got func(ctx context.Context, network, addr string) (net.Conn, error)) error { if reflect.ValueOf(w.want).Pointer() != reflect.ValueOf(got).Pointer() { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -506,10 +506,10 @@ func Test_dialer_lookup(t *testing.T) { } defaultCheckFunc := func(w want, got *dialerCache, err error, d *dialer) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -530,7 +530,7 @@ func Test_dialer_lookup(t *testing.T) { }, checkFunc: func(w want, got *dialerCache, err error, d *dialer) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got.Len() == 0 { @@ -555,7 +555,7 @@ func Test_dialer_lookup(t *testing.T) { }, checkFunc: func(w want, got *dialerCache, err error, d *dialer) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got.Len() == 0 { @@ -856,10 +856,10 @@ func Test_dialer_DialContext(t *testing.T) { } defaultCheckFunc := func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -941,10 +941,10 @@ func Test_dialer_cachedDialer(t *testing.T) { } defaultCheckFunc := func(d *dialer, w want, gotConn net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotConn, w.wantConn) { - return errors.Errorf("got = %v, want %v", gotConn, w.wantConn) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotConn, w.wantConn) } return nil } @@ -1437,7 +1437,7 @@ func Test_dialer_dial(t *testing.T) { } defaultCheckFunc := func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got == nil { return errors.New("got is nil") @@ -1494,7 +1494,7 @@ func Test_dialer_dial(t *testing.T) { }, checkFunc: func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got != nil { @@ -1522,7 +1522,7 @@ func Test_dialer_dial(t *testing.T) { }, checkFunc: func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got != nil { @@ -1550,7 +1550,7 @@ func Test_dialer_dial(t *testing.T) { }, checkFunc: func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got != nil { @@ -1577,7 +1577,7 @@ func Test_dialer_dial(t *testing.T) { }, checkFunc: func(w want, got net.Conn, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if got != nil { diff --git a/internal/net/tcp/option_test.go b/internal/net/tcp/option_test.go index 5d4dfedbbd6..ea186070fe5 100644 --- a/internal/net/tcp/option_test.go +++ b/internal/net/tcp/option_test.go @@ -48,7 +48,7 @@ func TestWithCache(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -125,7 +125,7 @@ func TestWithDNSRefreshDuration(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -204,7 +204,7 @@ func TestWithDNSCacheExpiration(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -285,7 +285,7 @@ func TestWithDialerTimeout(t *testing.T) { } defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -363,7 +363,7 @@ func TestWithDialerKeepAlive(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -441,7 +441,7 @@ func TestWithTLS(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -506,7 +506,7 @@ func TestWithEnableDNSCache(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -559,7 +559,7 @@ func TestWithDisableDNSCache(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -612,7 +612,7 @@ func TestWithEnableDialerDualStack(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -665,7 +665,7 @@ func TestWithDisableDialerDualStack(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/client/google/option_test.go b/internal/observability/client/google/option_test.go index f30d322b052..5e0637581dc 100644 --- a/internal/observability/client/google/option_test.go +++ b/internal/observability/client/google/option_test.go @@ -49,10 +49,10 @@ func TestWithAPIKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithAPIKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -163,10 +163,10 @@ func TestWithAudiences(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithAudiences(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -277,10 +277,10 @@ func TestWithCredentialsFile(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithCredentialsFile(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -391,10 +391,10 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -505,10 +505,10 @@ func TestWithQuotaProject(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -518,7 +518,7 @@ func TestWithQuotaProject(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -619,10 +619,10 @@ func TestWithRequestReason(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithRequestReason(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -733,10 +733,10 @@ func TestWithScopes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -746,7 +746,7 @@ func TestWithScopes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -847,10 +847,10 @@ func TestWithUserAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -860,7 +860,7 @@ func TestWithUserAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -961,10 +961,10 @@ func TestWithCredentialsJSON(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -974,7 +974,7 @@ func TestWithCredentialsJSON(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1075,10 +1075,10 @@ func TestWithTelemetry(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1088,7 +1088,7 @@ func TestWithTelemetry(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1189,10 +1189,10 @@ func TestWithAuthentication(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1202,7 +1202,7 @@ func TestWithAuthentication(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/collector/collector_option_test.go b/internal/observability/collector/collector_option_test.go index c14c09920d3..6a76eb4c1f6 100644 --- a/internal/observability/collector/collector_option_test.go +++ b/internal/observability/collector/collector_option_test.go @@ -51,10 +51,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -165,10 +165,10 @@ func TestWithDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -279,10 +279,10 @@ func TestWithMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -292,7 +292,7 @@ func TestWithMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -394,10 +394,10 @@ func TestWithVersionInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -407,7 +407,7 @@ func TestWithVersionInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -510,10 +510,10 @@ func TestWithMemoryMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -523,7 +523,7 @@ func TestWithMemoryMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -624,10 +624,10 @@ func TestWithGoroutineMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -637,7 +637,7 @@ func TestWithGoroutineMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -738,10 +738,10 @@ func TestWithCGOMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -751,7 +751,7 @@ func TestWithCGOMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/collector/collector_test.go b/internal/observability/collector/collector_test.go index 9899f3d12f8..1bab3743ce3 100644 --- a/internal/observability/collector/collector_test.go +++ b/internal/observability/collector/collector_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Collector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -128,7 +128,7 @@ func Test_collector_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -220,7 +220,7 @@ func Test_collector_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -399,7 +399,7 @@ func Test_collector_collect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/observability/exporter/jaeger/jaeger_option_test.go b/internal/observability/exporter/jaeger/jaeger_option_test.go index f17451bc28c..49c663d978e 100644 --- a/internal/observability/exporter/jaeger/jaeger_option_test.go +++ b/internal/observability/exporter/jaeger/jaeger_option_test.go @@ -49,10 +49,10 @@ func TestWithCollectorEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithCollectorEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -163,10 +163,10 @@ func TestWithAgentEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithAgentEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -277,10 +277,10 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -391,10 +391,10 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -505,10 +505,10 @@ func TestWithServiceName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -518,7 +518,7 @@ func TestWithServiceName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -619,10 +619,10 @@ func TestWithBufferMaxCount(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithBufferMaxCount(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -733,10 +733,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -746,7 +746,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/exporter/jaeger/jaeger_test.go b/internal/observability/exporter/jaeger/jaeger_test.go index d271000f9b0..4e2a01dd686 100644 --- a/internal/observability/exporter/jaeger/jaeger_test.go +++ b/internal/observability/exporter/jaeger/jaeger_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotJ Jaeger, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotJ, w.wantJ) { - return errors.Errorf("got = %v, want %v", gotJ, w.wantJ) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotJ, w.wantJ) } return nil } @@ -124,7 +124,7 @@ func Test_exp_Start(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/observability/exporter/prometheus/prometheus_option_test.go b/internal/observability/exporter/prometheus/prometheus_option_test.go index 21097a87968..6ceb9c39716 100644 --- a/internal/observability/exporter/prometheus/prometheus_option_test.go +++ b/internal/observability/exporter/prometheus/prometheus_option_test.go @@ -49,10 +49,10 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -163,10 +163,10 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -277,10 +277,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/exporter/prometheus/prometheus_test.go b/internal/observability/exporter/prometheus/prometheus_test.go index 598bdbb56e5..8afc700dfce 100644 --- a/internal/observability/exporter/prometheus/prometheus_test.go +++ b/internal/observability/exporter/prometheus/prometheus_test.go @@ -46,10 +46,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Prometheus, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -125,7 +125,7 @@ func Test_exp_Start(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -292,7 +292,7 @@ func Test_exp_NewHTTPHandler(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -366,10 +366,10 @@ func TestExporter(t *testing.T) { } defaultCheckFunc := func(w want, got Prometheus, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/exporter/stackdriver/stackdriver_option_test.go b/internal/observability/exporter/stackdriver/stackdriver_option_test.go index 77979eeaa43..c55fd13fb22 100644 --- a/internal/observability/exporter/stackdriver/stackdriver_option_test.go +++ b/internal/observability/exporter/stackdriver/stackdriver_option_test.go @@ -53,10 +53,10 @@ func TestWithMonitoring(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -66,7 +66,7 @@ func TestWithMonitoring(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -167,10 +167,10 @@ func TestWithTracing(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -180,7 +180,7 @@ func TestWithTracing(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -281,10 +281,10 @@ func TestWithProjectID(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -294,7 +294,7 @@ func TestWithProjectID(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -395,10 +395,10 @@ func TestWithLocation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -408,7 +408,7 @@ func TestWithLocation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -509,10 +509,10 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -522,7 +522,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -623,10 +623,10 @@ func TestWithMonitoringClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -636,7 +636,7 @@ func TestWithMonitoringClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -737,10 +737,10 @@ func TestWithTraceClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -750,7 +750,7 @@ func TestWithTraceClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -851,10 +851,10 @@ func TestWithBundleDelayThreshold(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -864,7 +864,7 @@ func TestWithBundleDelayThreshold(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -965,10 +965,10 @@ func TestWithBundleCountThreshold(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -978,7 +978,7 @@ func TestWithBundleCountThreshold(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1079,10 +1079,10 @@ func TestWithTraceSpansBufferMaxBytes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1092,7 +1092,7 @@ func TestWithTraceSpansBufferMaxBytes(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1193,10 +1193,10 @@ func TestWithMonitoredResource(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1206,7 +1206,7 @@ func TestWithMonitoredResource(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1307,10 +1307,10 @@ func TestWithMetricPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1320,7 +1320,7 @@ func TestWithMetricPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1421,10 +1421,10 @@ func TestWithGetMetricDisplayName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1434,7 +1434,7 @@ func TestWithGetMetricDisplayName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1535,10 +1535,10 @@ func TestWithGetMetricPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1548,7 +1548,7 @@ func TestWithGetMetricPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1649,10 +1649,10 @@ func TestWithDefaultMonitoringLabels(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1662,7 +1662,7 @@ func TestWithDefaultMonitoringLabels(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1763,10 +1763,10 @@ func TestWithSkipCMD(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1776,7 +1776,7 @@ func TestWithSkipCMD(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1877,10 +1877,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1890,7 +1890,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1991,10 +1991,10 @@ func TestWithReportingInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2004,7 +2004,7 @@ func TestWithReportingInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2105,10 +2105,10 @@ func TestWithNumberOfWorkers(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2118,7 +2118,7 @@ func TestWithNumberOfWorkers(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/exporter/stackdriver/stackdriver_test.go b/internal/observability/exporter/stackdriver/stackdriver_test.go index 8ee18618a5c..1d280c3dbda 100644 --- a/internal/observability/exporter/stackdriver/stackdriver_test.go +++ b/internal/observability/exporter/stackdriver/stackdriver_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotS Stackdriver, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotS, w.wantS) { - return errors.Errorf("got = %v, want %v", gotS, w.wantS) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotS, w.wantS) } return nil } @@ -126,7 +126,7 @@ func Test_exp_Start(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/observability/metrics/agent/core/ngt/ngt_test.go b/internal/observability/metrics/agent/core/ngt/ngt_test.go index cd4bf71f8fb..2112197efbc 100644 --- a/internal/observability/metrics/agent/core/ngt/ngt_test.go +++ b/internal/observability/metrics/agent/core/ngt/ngt_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -127,10 +127,10 @@ func Test_ngtMetrics_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -235,10 +235,10 @@ func Test_ngtMetrics_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -338,7 +338,7 @@ func Test_ngtMetrics_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/manager/compressor/compressor_test.go b/internal/observability/metrics/manager/compressor/compressor_test.go index 64ea569d71f..d6037433b6e 100644 --- a/internal/observability/metrics/manager/compressor/compressor_test.go +++ b/internal/observability/metrics/manager/compressor/compressor_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -132,10 +132,10 @@ func Test_compressorMetrics_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -248,10 +248,10 @@ func Test_compressorMetrics_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -359,7 +359,7 @@ func Test_compressorMetrics_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/mem/mem_test.go b/internal/observability/metrics/mem/mem_test.go index 73cb52737ab..083ddca5ff0 100644 --- a/internal/observability/metrics/mem/mem_test.go +++ b/internal/observability/metrics/mem/mem_test.go @@ -40,7 +40,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -123,10 +123,10 @@ func Test_memory_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -263,10 +263,10 @@ func Test_memory_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -398,7 +398,7 @@ func Test_memory_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/metrics_test.go b/internal/observability/metrics/metrics_test.go index b79eaea8eea..230f30e78dd 100644 --- a/internal/observability/metrics/metrics_test.go +++ b/internal/observability/metrics/metrics_test.go @@ -44,7 +44,7 @@ func TestRegisterView(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -185,7 +185,7 @@ func TestRecordWithTags(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -258,7 +258,7 @@ func TestMeasurementsCount(t *testing.T) { } defaultCheckFunc := func(w want, got int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/runtime/cgo/cgo_test.go b/internal/observability/metrics/runtime/cgo/cgo_test.go index 795734a6572..a44bf5cf0cc 100644 --- a/internal/observability/metrics/runtime/cgo/cgo_test.go +++ b/internal/observability/metrics/runtime/cgo/cgo_test.go @@ -41,7 +41,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -111,10 +111,10 @@ func Test_cgo_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -199,10 +199,10 @@ func Test_cgo_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -282,7 +282,7 @@ func Test_cgo_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/runtime/goroutine/goroutine_test.go b/internal/observability/metrics/runtime/goroutine/goroutine_test.go index ad034ffcec7..987816b432d 100644 --- a/internal/observability/metrics/runtime/goroutine/goroutine_test.go +++ b/internal/observability/metrics/runtime/goroutine/goroutine_test.go @@ -41,7 +41,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -111,10 +111,10 @@ func Test_goroutines_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -199,10 +199,10 @@ func Test_goroutines_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -282,7 +282,7 @@ func Test_goroutines_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/metrics/version/version_test.go b/internal/observability/metrics/version/version_test.go index c308124c241..0cda01b6bd0 100644 --- a/internal/observability/metrics/version/version_test.go +++ b/internal/observability/metrics/version/version_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got metrics.Metric, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -120,10 +120,10 @@ func Test_labelKVs(t *testing.T) { } defaultCheckFunc := func(w want, got map[metrics.Key]string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -200,10 +200,10 @@ func Test_version_Measurement(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.Measurement, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -292,10 +292,10 @@ func Test_version_MeasurementWithTags(t *testing.T) { } defaultCheckFunc := func(w want, got []metrics.MeasurementWithTags, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -379,7 +379,7 @@ func Test_version_View(t *testing.T) { } defaultCheckFunc := func(w want, got []*metrics.View) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/observability_option_test.go b/internal/observability/observability_option_test.go index 650d34e84b1..c0e7801b21c 100644 --- a/internal/observability/observability_option_test.go +++ b/internal/observability/observability_option_test.go @@ -54,10 +54,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -67,7 +67,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -168,10 +168,10 @@ func TestWithCollector(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -181,7 +181,7 @@ func TestWithCollector(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -282,10 +282,10 @@ func TestWithTracer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -295,7 +295,7 @@ func TestWithTracer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -396,10 +396,10 @@ func TestWithExporters(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -409,7 +409,7 @@ func TestWithExporters(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -510,10 +510,10 @@ func TestWithProfilers(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -523,7 +523,7 @@ func TestWithProfilers(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/observability_test.go b/internal/observability/observability_test.go index 847d17775b5..5530905a19c 100644 --- a/internal/observability/observability_test.go +++ b/internal/observability/observability_test.go @@ -52,10 +52,10 @@ func TestNewWithConfig(t *testing.T) { } defaultCheckFunc := func(w want, got Observability, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Observability, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -211,7 +211,7 @@ func Test_observability_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -311,7 +311,7 @@ func Test_observability_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/profiler/stackdriver/stackdriver_option_test.go b/internal/observability/profiler/stackdriver/stackdriver_option_test.go index 407352e1b57..a3d8820c7fd 100644 --- a/internal/observability/profiler/stackdriver/stackdriver_option_test.go +++ b/internal/observability/profiler/stackdriver/stackdriver_option_test.go @@ -50,10 +50,10 @@ func TestWithProjectID(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithProjectID(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -164,10 +164,10 @@ func TestWithService(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithService(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -278,10 +278,10 @@ func TestWithServiceVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -291,7 +291,7 @@ func TestWithServiceVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -392,10 +392,10 @@ func TestWithDebugLogging(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -405,7 +405,7 @@ func TestWithDebugLogging(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -506,10 +506,10 @@ func TestWithMutexProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -519,7 +519,7 @@ func TestWithMutexProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -620,10 +620,10 @@ func TestWithCPUProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -633,7 +633,7 @@ func TestWithCPUProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -734,10 +734,10 @@ func TestWithAllocProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -747,7 +747,7 @@ func TestWithAllocProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -848,10 +848,10 @@ func TestWithHeapProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -861,7 +861,7 @@ func TestWithHeapProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -962,10 +962,10 @@ func TestWithGoroutineProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -975,7 +975,7 @@ func TestWithGoroutineProfiling(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1076,10 +1076,10 @@ func TestWithAllocForceGC(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1089,7 +1089,7 @@ func TestWithAllocForceGC(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1190,10 +1190,10 @@ func TestWithAPIAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1203,7 +1203,7 @@ func TestWithAPIAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1304,10 +1304,10 @@ func TestWithInstance(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1317,7 +1317,7 @@ func TestWithInstance(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1418,10 +1418,10 @@ func TestWithZone(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1431,7 +1431,7 @@ func TestWithZone(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1532,10 +1532,10 @@ func TestWithClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1545,7 +1545,7 @@ func TestWithClientOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/observability/profiler/stackdriver/stackdriver_test.go b/internal/observability/profiler/stackdriver/stackdriver_test.go index 3fbe7f43fd7..eaa89b27ba8 100644 --- a/internal/observability/profiler/stackdriver/stackdriver_test.go +++ b/internal/observability/profiler/stackdriver/stackdriver_test.go @@ -46,10 +46,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotS Stackdriver, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotS, w.wantS) { - return errors.Errorf("got = %v, want %v", gotS, w.wantS) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotS, w.wantS) } return nil } @@ -125,7 +125,7 @@ func Test_prof_Start(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/observability/trace/status_test.go b/internal/observability/trace/status_test.go index b5a6aaee27f..acb03b4de15 100644 --- a/internal/observability/trace/status_test.go +++ b/internal/observability/trace/status_test.go @@ -42,7 +42,7 @@ func TestStatusCodeOK(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -112,7 +112,7 @@ func TestStatusCodeCancelled(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -182,7 +182,7 @@ func TestStatusCodeUnknown(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -252,7 +252,7 @@ func TestStatusCodeInvalidArgument(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -322,7 +322,7 @@ func TestStatusCodeDeadlineExceeded(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -392,7 +392,7 @@ func TestStatusCodeNotFound(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -462,7 +462,7 @@ func TestStatusCodeAlreadyExists(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -532,7 +532,7 @@ func TestStatusCodePermissionDenied(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -602,7 +602,7 @@ func TestStatusCodeResourceExhausted(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -672,7 +672,7 @@ func TestStatusCodeFailedPrecondition(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -742,7 +742,7 @@ func TestStatusCodeAborted(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -812,7 +812,7 @@ func TestStatusCodeOutOfRange(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -882,7 +882,7 @@ func TestStatusCodeUnimplemented(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -952,7 +952,7 @@ func TestStatusCodeInternal(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1022,7 +1022,7 @@ func TestStatusCodeUnavailable(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1092,7 +1092,7 @@ func TestStatusCodeDataLoss(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1162,7 +1162,7 @@ func TestStatusCodeUnauthenticated(t *testing.T) { } defaultCheckFunc := func(w want, got trace.Status) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/observability/trace/trace_option_test.go b/internal/observability/trace/trace_option_test.go index 0563b8045ee..af129e2a6c3 100644 --- a/internal/observability/trace/trace_option_test.go +++ b/internal/observability/trace/trace_option_test.go @@ -48,10 +48,10 @@ func TestWithSamplingRate(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -61,7 +61,7 @@ func TestWithSamplingRate(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/observability/trace/trace_test.go b/internal/observability/trace/trace_test.go index 88e1265fe74..1a6a32e712c 100644 --- a/internal/observability/trace/trace_test.go +++ b/internal/observability/trace/trace_test.go @@ -46,10 +46,10 @@ func TestStartSpan(t *testing.T) { } defaultCheckFunc := func(w want, got context.Context, got1 *Span) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -123,7 +123,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Tracer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/params/option_test.go b/internal/params/option_test.go index 86d7deb35ff..b45d10029db 100644 --- a/internal/params/option_test.go +++ b/internal/params/option_test.go @@ -44,7 +44,7 @@ func TestWithConfigFilePathKeys(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -115,7 +115,7 @@ func TestWithConfigFilePathDefault(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -182,7 +182,7 @@ func TestWithConfigFileDescription(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -249,7 +249,7 @@ func TestWithVersionKeys(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -320,7 +320,7 @@ func TestWithVersionFlagDefault(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -387,7 +387,7 @@ func TestWithVersionDescription(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/params/params_test.go b/internal/params/params_test.go index ee54b96e155..5113c3ba421 100644 --- a/internal/params/params_test.go +++ b/internal/params/params_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got *parser) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -178,13 +178,13 @@ func Test_parser_Parse(t *testing.T) { } defaultCheckFunc := func(w want, got Data, got1 bool, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -329,7 +329,7 @@ func Test_data_ConfigFilePath(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -386,7 +386,7 @@ func Test_data_ShowVersion(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/runner/option_test.go b/internal/runner/option_test.go index cc2d3774ed0..3054961b8d0 100644 --- a/internal/runner/option_test.go +++ b/internal/runner/option_test.go @@ -53,7 +53,7 @@ func TestWithName(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -123,7 +123,7 @@ func TestWithVersion(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -237,7 +237,7 @@ func TestWithConfigLoader(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if reflect.ValueOf(w.obj.loadConfig).Pointer() != reflect.ValueOf(obj.loadConfig).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -310,7 +310,7 @@ func TestWithDaemonInitializer(t *testing.T) { defaultCheckFunc := func(w want, obj *T) error { if reflect.ValueOf(w.obj.loadConfig).Pointer() != reflect.ValueOf(obj.loadConfig).Pointer() { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/runner/runner_test.go b/internal/runner/runner_test.go index 22508690a1b..bb9157b4e04 100644 --- a/internal/runner/runner_test.go +++ b/internal/runner/runner_test.go @@ -55,7 +55,7 @@ func TestDo(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -268,7 +268,7 @@ func TestRun(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/safety/safety_test.go b/internal/safety/safety_test.go index d51fb4ea071..b460d528abe 100644 --- a/internal/safety/safety_test.go +++ b/internal/safety/safety_test.go @@ -60,7 +60,7 @@ func TestRecoverFunc(t *testing.T) { } if (w.want == nil && got != nil) || (w.want != nil && got == nil) { - return errors.Errorf("got = %v, want %v", got, w) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w) } wantErr := w.want() if !errors.Is(gotErr, wantErr) { @@ -178,7 +178,7 @@ func TestRecoverWithoutPanicFunc(t *testing.T) { } defaultCheckFunc := func(w want, got func() error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -250,7 +250,7 @@ func Test_recoverFunc(t *testing.T) { } defaultCheckFunc := func(w want, got func() error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/servers/server/option_test.go b/internal/servers/server/option_test.go index e2162696b38..560853f9cb2 100644 --- a/internal/servers/server/option_test.go +++ b/internal/servers/server/option_test.go @@ -2426,10 +2426,10 @@ func TestWithPreStopFunction(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -2439,7 +2439,7 @@ func TestWithPreStopFunction(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/servers/server/server_test.go b/internal/servers/server/server_test.go index 43d7e7031db..c229c2ea845 100644 --- a/internal/servers/server/server_test.go +++ b/internal/servers/server/server_test.go @@ -681,7 +681,7 @@ func Test_mode_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -776,7 +776,7 @@ func Test_server_IsRunning(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -943,7 +943,7 @@ func Test_server_Name(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1115,7 +1115,7 @@ func Test_server_ListenAndServe(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1294,7 +1294,7 @@ func Test_server_Shutdown(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/servers/servers_test.go b/internal/servers/servers_test.go index 41750fc3d21..c1dd7bdcb09 100644 --- a/internal/servers/servers_test.go +++ b/internal/servers/servers_test.go @@ -384,7 +384,7 @@ func Test_listener_ListenAndServe(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -484,7 +484,7 @@ func Test_listener_Shutdown(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/internal/servers/starter/starter_test.go b/internal/servers/starter/starter_test.go index 594daf468b9..621b326cfb4 100644 --- a/internal/servers/starter/starter_test.go +++ b/internal/servers/starter/starter_test.go @@ -493,10 +493,10 @@ func Test_srvs_setupAPIs(t *testing.T) { } defaultCheckFunc := func(w want, got []servers.Option, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -601,10 +601,10 @@ func Test_srvs_setupHealthCheck(t *testing.T) { } defaultCheckFunc := func(w want, got []servers.Option, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -709,10 +709,10 @@ func Test_srvs_setupMetrics(t *testing.T) { } defaultCheckFunc := func(w want, got []servers.Option, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/singleflight/singleflight_test.go b/internal/singleflight/singleflight_test.go index 8c2ed221c40..e054a5b597d 100644 --- a/internal/singleflight/singleflight_test.go +++ b/internal/singleflight/singleflight_test.go @@ -43,7 +43,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Group) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -110,13 +110,13 @@ func Test_group_Do(t *testing.T) { } defaultCheckFunc := func(w want, gotV interface{}, gotShared bool, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotV, w.wantV) { - return errors.Errorf("got = %v, want %v", gotV, w.wantV) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotV, w.wantV) } if !reflect.DeepEqual(gotShared, w.wantShared) { - return errors.Errorf("got = %v, want %v", gotShared, w.wantShared) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotShared, w.wantShared) } return nil } diff --git a/internal/test/testdata_test.go b/internal/test/testdata_test.go index 0ba6bea76f9..8b5c695685c 100644 --- a/internal/test/testdata_test.go +++ b/internal/test/testdata_test.go @@ -41,7 +41,7 @@ func TestGetTestdataPath(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -93,7 +93,7 @@ func Test_baseDir(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/timeutil/time_test.go b/internal/timeutil/time_test.go index d7f7f06da7c..fe449efc485 100644 --- a/internal/timeutil/time_test.go +++ b/internal/timeutil/time_test.go @@ -109,7 +109,7 @@ func TestParseWithDefault(t *testing.T) { } defaultCheckFunc := func(w want, got time.Duration) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/tls/option_test.go b/internal/tls/option_test.go index 83d17c6ab76..e0a1415d60f 100644 --- a/internal/tls/option_test.go +++ b/internal/tls/option_test.go @@ -45,10 +45,10 @@ func TestWithCert(t *testing.T) { } defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -120,10 +120,10 @@ func TestWithKey(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -195,10 +195,10 @@ func TestWithCa(t *testing.T) { defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -269,10 +269,10 @@ func TestWithTLSConfig(t *testing.T) { } defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/internal/tls/tls_test.go b/internal/tls/tls_test.go index a1b5556cab7..5f8765652c6 100644 --- a/internal/tls/tls_test.go +++ b/internal/tls/tls_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got *Config, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -83,7 +83,7 @@ func TestNew(t *testing.T) { }, checkFunc: func(w want, c *tls.Config, err error) error { if !errors.Is(err, w.err) { - return fmt.Errorf("got error = %v, wantErr %v", err, w.err) + return fmt.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if len(c.Certificates) != 1 && len(c.Certificates) != len(w.want.Certificates) { @@ -211,10 +211,10 @@ func TestNewClientConfig(t *testing.T) { } defaultCheckFunc := func(w want, got *Config, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -223,7 +223,7 @@ func TestNewClientConfig(t *testing.T) { name: "returns cfg and nil when option is empty", checkFunc: func(w want, c *Config, err error) error { if !errors.Is(err, w.err) { - return fmt.Errorf("got error = %v, wantErr %v", err, w.err) + return fmt.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if c == nil { return errors.New("config is nil") @@ -241,7 +241,7 @@ func TestNewClientConfig(t *testing.T) { }, checkFunc: func(w want, c *Config, err error) error { if !errors.Is(err, w.err) { - return fmt.Errorf("got error = %v, wantErr %v", err, w.err) + return fmt.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if c == nil { return errors.New("config is nil") @@ -274,7 +274,7 @@ func TestNewClientConfig(t *testing.T) { checkFunc: func(w want, c *Config, err error) error { wantErr := "tls: failed to find any PEM data in certificate input" if err.Error() != wantErr { - return fmt.Errorf("got error = %v, wantErr = %v", err, w.err) + return fmt.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if c != nil { return errors.Errorf("config is not nil: %v", c) @@ -324,10 +324,10 @@ func TestNewX509CertPool(t *testing.T) { } defaultCheckFunc := func(w want, got *x509.CertPool, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/unit/unit_test.go b/internal/unit/unit_test.go index 91ba2fa1957..58bcf933aa5 100644 --- a/internal/unit/unit_test.go +++ b/internal/unit/unit_test.go @@ -43,10 +43,10 @@ func TestParseBytes(t *testing.T) { } defaultCheckFunc := func(w want, gotBytes uint64, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotBytes, w.wantBytes) { - return errors.Errorf("got = %v, want %v", gotBytes, w.wantBytes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotBytes, w.wantBytes) } return nil } diff --git a/internal/worker/queue_option_test.go b/internal/worker/queue_option_test.go index 06f6b77966b..5d4af2cdfb3 100644 --- a/internal/worker/queue_option_test.go +++ b/internal/worker/queue_option_test.go @@ -49,10 +49,10 @@ func TestWithQueueBuffer(t *testing.T) { defaultCheckFunc := func(w want, got *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } @@ -122,10 +122,10 @@ func TestWithQueueErrGroup(t *testing.T) { } defaultCheckFunc := func(w want, got *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.obj) { - return errors.Errorf("got = %v, want %v", got, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.obj) } return nil } @@ -192,7 +192,7 @@ func TestWithQueueCheckDuration(t *testing.T) { } defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want = %v", err, w.err) + return errors.Errorf("got_error: \"%+v\",\twant: \"%+v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { return errors.Errorf("got = %v, want = %v", obj, w.obj) diff --git a/internal/worker/queue_test.go b/internal/worker/queue_test.go index b66ca93a3ab..05df205b4bc 100644 --- a/internal/worker/queue_test.go +++ b/internal/worker/queue_test.go @@ -56,7 +56,7 @@ func TestNewQueue(t *testing.T) { } defaultCheckFunc := func(w want, got Queue, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if w.want == nil && got == nil { @@ -64,7 +64,7 @@ func TestNewQueue(t *testing.T) { } if (w.want == nil && got != nil) || (w.want != nil && got == nil) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } egComparator := func(want, got errgroup.Group) bool { @@ -182,7 +182,7 @@ func Test_queue_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if w.want == nil && got == nil { @@ -386,7 +386,7 @@ func Test_queue_isRunning(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -459,7 +459,7 @@ func Test_queue_Push(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -625,10 +625,10 @@ func Test_queue_Pop(t *testing.T) { } defaultCheckFunc := func(w want, got JobFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.want).Pointer() != reflect.ValueOf(got).Pointer() { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -729,10 +729,10 @@ func Test_queue_pop(t *testing.T) { } defaultCheckFunc := func(w want, got JobFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if reflect.ValueOf(w.want).Pointer() != reflect.ValueOf(got).Pointer() { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -914,7 +914,7 @@ func Test_queue_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/internal/worker/worker_option_test.go b/internal/worker/worker_option_test.go index b8df10d160d..c765c64dd13 100644 --- a/internal/worker/worker_option_test.go +++ b/internal/worker/worker_option_test.go @@ -50,10 +50,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithLimitation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithLimitation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithQueueOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithQueueOption(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/internal/worker/worker_test.go b/internal/worker/worker_test.go index 68a9d22002a..f9bdf57ebcd 100644 --- a/internal/worker/worker_test.go +++ b/internal/worker/worker_test.go @@ -50,7 +50,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Worker, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } egComparator := func(x, y errgroup.Group) bool { @@ -199,7 +199,7 @@ func Test_worker_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if w.want == nil && got == nil { @@ -748,7 +748,7 @@ func Test_worker_IsRunning(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -835,7 +835,7 @@ func Test_worker_Name(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -907,7 +907,7 @@ func Test_worker_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -983,7 +983,7 @@ func Test_worker_TotalRequested(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1055,7 +1055,7 @@ func Test_worker_TotalCompleted(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1132,7 +1132,7 @@ func Test_worker_Dispatch(t *testing.T) { } defaultCheckFunc := func(worker *worker, w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/core/ngt/config/config_test.go b/pkg/agent/core/ngt/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/agent/core/ngt/config/config_test.go +++ b/pkg/agent/core/ngt/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/agent/core/ngt/handler/grpc/handler_test.go b/pkg/agent/core/ngt/handler/grpc/handler_test.go index cff96d42abb..cfc2313b209 100644 --- a/pkg/agent/core/ngt/handler/grpc/handler_test.go +++ b/pkg/agent/core/ngt/handler/grpc/handler_test.go @@ -48,7 +48,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -126,10 +126,10 @@ func Test_server_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Object_ID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -221,10 +221,10 @@ func Test_server_Search(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -316,10 +316,10 @@ func Test_server_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -406,10 +406,10 @@ func Test_toSearchResponse(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -487,7 +487,7 @@ func Test_server_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -575,7 +575,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -665,10 +665,10 @@ func Test_server_Insert(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -758,7 +758,7 @@ func Test_server_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -848,10 +848,10 @@ func Test_server_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -943,10 +943,10 @@ func Test_server_Update(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1036,7 +1036,7 @@ func Test_server_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1126,10 +1126,10 @@ func Test_server_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1221,10 +1221,10 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1314,7 +1314,7 @@ func Test_server_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1404,10 +1404,10 @@ func Test_server_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1499,10 +1499,10 @@ func Test_server_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Object_Vector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1592,7 +1592,7 @@ func Test_server_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1682,10 +1682,10 @@ func Test_server_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1777,10 +1777,10 @@ func Test_server_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1872,10 +1872,10 @@ func Test_server_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1967,10 +1967,10 @@ func Test_server_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Info_Index_Count, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/agent/core/ngt/handler/grpc/option_test.go b/pkg/agent/core/ngt/handler/grpc/option_test.go index 169f3a072ee..d23807a196d 100644 --- a/pkg/agent/core/ngt/handler/grpc/option_test.go +++ b/pkg/agent/core/ngt/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithNGT(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithNGT(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithStreamConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithStreamConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/core/ngt/handler/rest/handler_test.go b/pkg/agent/core/ngt/handler/rest/handler_test.go index 980e2e360f4..c896f74faed 100644 --- a/pkg/agent/core/ngt/handler/rest/handler_test.go +++ b/pkg/agent/core/ngt/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Search(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -304,10 +304,10 @@ func Test_handler_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -395,10 +395,10 @@ func Test_handler_Insert(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -486,10 +486,10 @@ func Test_handler_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -577,10 +577,10 @@ func Test_handler_Update(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -668,10 +668,10 @@ func Test_handler_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -759,10 +759,10 @@ func Test_handler_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -850,10 +850,10 @@ func Test_handler_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -941,10 +941,10 @@ func Test_handler_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -1032,10 +1032,10 @@ func Test_handler_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -1123,10 +1123,10 @@ func Test_handler_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -1214,10 +1214,10 @@ func Test_handler_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -1305,10 +1305,10 @@ func Test_handler_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } diff --git a/pkg/agent/core/ngt/handler/rest/option_test.go b/pkg/agent/core/ngt/handler/rest/option_test.go index 32d808a5d6e..3e98190521a 100644 --- a/pkg/agent/core/ngt/handler/rest/option_test.go +++ b/pkg/agent/core/ngt/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/core/ngt/router/option_test.go b/pkg/agent/core/ngt/router/option_test.go index 29b650563ec..3d575566e5c 100644 --- a/pkg/agent/core/ngt/router/option_test.go +++ b/pkg/agent/core/ngt/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/core/ngt/router/router_test.go b/pkg/agent/core/ngt/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/agent/core/ngt/router/router_test.go +++ b/pkg/agent/core/ngt/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/core/ngt/service/kvs/kvs_test.go b/pkg/agent/core/ngt/service/kvs/kvs_test.go index 109253f8ced..3215664b38c 100644 --- a/pkg/agent/core/ngt/service/kvs/kvs_test.go +++ b/pkg/agent/core/ngt/service/kvs/kvs_test.go @@ -37,7 +37,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got BidiMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -108,10 +108,10 @@ func Test_bidi_Get(t *testing.T) { } defaultCheckFunc := func(w want, got uint32, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -203,10 +203,10 @@ func Test_bidi_GetInverse(t *testing.T) { } defaultCheckFunc := func(w want, got string, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -387,10 +387,10 @@ func Test_bidi_Delete(t *testing.T) { } defaultCheckFunc := func(w want, gotVal uint32, gotOk bool) error { if !reflect.DeepEqual(gotVal, w.wantVal) { - return errors.Errorf("got = %v, want %v", gotVal, w.wantVal) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVal, w.wantVal) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -482,10 +482,10 @@ func Test_bidi_DeleteInverse(t *testing.T) { } defaultCheckFunc := func(w want, gotKey string, gotOk bool) error { if !reflect.DeepEqual(gotKey, w.wantKey) { - return errors.Errorf("got = %v, want %v", gotKey, w.wantKey) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotKey, w.wantKey) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -661,7 +661,7 @@ func Test_bidi_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/core/ngt/service/kvs/ou_test.go b/pkg/agent/core/ngt/service/kvs/ou_test.go index 1d80c421aba..b7bfa5e0309 100644 --- a/pkg/agent/core/ngt/service/kvs/ou_test.go +++ b/pkg/agent/core/ngt/service/kvs/ou_test.go @@ -43,7 +43,7 @@ func Test_newEntryOu(t *testing.T) { } defaultCheckFunc := func(w want, got *entryOu) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -121,10 +121,10 @@ func Test_ou_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue string, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -213,10 +213,10 @@ func Test_entryOu_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue string, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -386,7 +386,7 @@ func Test_entryOu_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -465,7 +465,7 @@ func Test_entryOu_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -706,7 +706,7 @@ func Test_entryOu_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -939,7 +939,7 @@ func Test_entryOu_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/agent/core/ngt/service/kvs/uo_test.go b/pkg/agent/core/ngt/service/kvs/uo_test.go index e95765c605f..3829ffc9d5d 100644 --- a/pkg/agent/core/ngt/service/kvs/uo_test.go +++ b/pkg/agent/core/ngt/service/kvs/uo_test.go @@ -43,7 +43,7 @@ func Test_newEntryUo(t *testing.T) { } defaultCheckFunc := func(w want, got *entryUo) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -121,10 +121,10 @@ func Test_uo_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue uint32, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -213,10 +213,10 @@ func Test_entryUo_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue uint32, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -386,7 +386,7 @@ func Test_entryUo_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -465,7 +465,7 @@ func Test_entryUo_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -706,7 +706,7 @@ func Test_entryUo_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1029,7 +1029,7 @@ func Test_entryUo_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/agent/core/ngt/service/ngt_test.go b/pkg/agent/core/ngt/service/ngt_test.go index 3b90b090086..d18f467aee5 100644 --- a/pkg/agent/core/ngt/service/ngt_test.go +++ b/pkg/agent/core/ngt/service/ngt_test.go @@ -53,10 +53,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotNn NGT, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotNn, w.wantNn) { - return errors.Errorf("got = %v, want %v", gotNn, w.wantNn) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotNn, w.wantNn) } return nil } @@ -155,7 +155,7 @@ func Test_ngt_initNGT(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -323,7 +323,7 @@ func Test_ngt_loadKVS(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -489,7 +489,7 @@ func Test_ngt_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -665,10 +665,10 @@ func Test_ngt_Search(t *testing.T) { } defaultCheckFunc := func(w want, got []model.Distance, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -850,10 +850,10 @@ func Test_ngt_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotDst []model.Distance, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotDst, w.wantDst) { - return errors.Errorf("got = %v, want %v", gotDst, w.wantDst) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDst, w.wantDst) } return nil } @@ -1032,7 +1032,7 @@ func Test_ngt_Insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1209,7 +1209,7 @@ func Test_ngt_insert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1387,7 +1387,7 @@ func Test_ngt_InsertMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1560,7 +1560,7 @@ func Test_ngt_Update(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1734,7 +1734,7 @@ func Test_ngt_UpdateMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1906,7 +1906,7 @@ func Test_ngt_Delete(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2079,7 +2079,7 @@ func Test_ngt_delete(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2253,7 +2253,7 @@ func Test_ngt_DeleteMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2426,10 +2426,10 @@ func Test_ngt_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotVec []float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -2602,7 +2602,7 @@ func Test_ngt_CreateIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2776,7 +2776,7 @@ func Test_ngt_SaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2948,7 +2948,7 @@ func Test_ngt_saveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -3121,7 +3121,7 @@ func Test_ngt_CreateAndSaveIndex(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -3296,10 +3296,10 @@ func Test_ngt_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotOid uint32, gotOk bool) error { if !reflect.DeepEqual(gotOid, w.wantOid) { - return errors.Errorf("got = %v, want %v", gotOid, w.wantOid) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOid, w.wantOid) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -3472,10 +3472,10 @@ func Test_ngt_insertCache(t *testing.T) { } defaultCheckFunc := func(w want, got *vcache, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -3643,7 +3643,7 @@ func Test_ngt_IsIndexing(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -3809,7 +3809,7 @@ func Test_ngt_UUIDs(t *testing.T) { } defaultCheckFunc := func(w want, gotUuids []string) error { if !reflect.DeepEqual(gotUuids, w.wantUuids) { - return errors.Errorf("got = %v, want %v", gotUuids, w.wantUuids) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotUuids, w.wantUuids) } return nil } @@ -3977,7 +3977,7 @@ func Test_ngt_UncommittedUUIDs(t *testing.T) { } defaultCheckFunc := func(w want, gotUuids []string) error { if !reflect.DeepEqual(gotUuids, w.wantUuids) { - return errors.Errorf("got = %v, want %v", gotUuids, w.wantUuids) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotUuids, w.wantUuids) } return nil } @@ -4139,7 +4139,7 @@ func Test_ngt_NumberOfCreateIndexExecution(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -4301,7 +4301,7 @@ func Test_ngt_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -4463,7 +4463,7 @@ func Test_ngt_InsertVCacheLen(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -4625,7 +4625,7 @@ func Test_ngt_DeleteVCacheLen(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -4791,7 +4791,7 @@ func Test_ngt_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/core/ngt/service/option_test.go b/pkg/agent/core/ngt/service/option_test.go index e2d5b7475cc..621630dd049 100644 --- a/pkg/agent/core/ngt/service/option_test.go +++ b/pkg/agent/core/ngt/service/option_test.go @@ -49,10 +49,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -163,10 +163,10 @@ func TestWithEnableInMemoryMode(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithEnableInMemoryMode(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -277,10 +277,10 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -391,10 +391,10 @@ func TestWithAutoIndexCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithAutoIndexCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -505,10 +505,10 @@ func TestWithAutoIndexDurationLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -518,7 +518,7 @@ func TestWithAutoIndexDurationLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -619,10 +619,10 @@ func TestWithAutoSaveIndexDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithAutoSaveIndexDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -733,10 +733,10 @@ func TestWithAutoIndexLength(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -746,7 +746,7 @@ func TestWithAutoIndexLength(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -847,10 +847,10 @@ func TestWithInitialDelayMaxDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -860,7 +860,7 @@ func TestWithInitialDelayMaxDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -961,10 +961,10 @@ func TestWithMinLoadIndexTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -974,7 +974,7 @@ func TestWithMinLoadIndexTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1075,10 +1075,10 @@ func TestWithMaxLoadIndexTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1088,7 +1088,7 @@ func TestWithMaxLoadIndexTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1189,10 +1189,10 @@ func TestWithLoadIndexTimeoutFactor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1202,7 +1202,7 @@ func TestWithLoadIndexTimeoutFactor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1303,10 +1303,10 @@ func TestWithDefaultPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1316,7 +1316,7 @@ func TestWithDefaultPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1417,10 +1417,10 @@ func TestWithDefaultRadius(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1430,7 +1430,7 @@ func TestWithDefaultRadius(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1531,10 +1531,10 @@ func TestWithDefaultEpsilon(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -1544,7 +1544,7 @@ func TestWithDefaultEpsilon(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/pkg/agent/core/ngt/service/vcaches_test.go b/pkg/agent/core/ngt/service/vcaches_test.go index e6f9cad03a0..44f38f4ebc8 100644 --- a/pkg/agent/core/ngt/service/vcaches_test.go +++ b/pkg/agent/core/ngt/service/vcaches_test.go @@ -43,7 +43,7 @@ func Test_newEntryVCache(t *testing.T) { } defaultCheckFunc := func(w want, got *entryVCache) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_vcaches_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue vcache, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -217,10 +217,10 @@ func Test_entryVCache_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue vcache, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -394,7 +394,7 @@ func Test_entryVCache_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -473,7 +473,7 @@ func Test_entryVCache_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -718,7 +718,7 @@ func Test_entryVCache_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1053,7 +1053,7 @@ func Test_entryVCache_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } @@ -1130,7 +1130,7 @@ func Test_vcaches_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/core/ngt/usecase/agentd_test.go b/pkg/agent/core/ngt/usecase/agentd_test.go index 8f2da9be5c3..582a46903a0 100644 --- a/pkg/agent/core/ngt/usecase/agentd_test.go +++ b/pkg/agent/core/ngt/usecase/agentd_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/sidecar/config/config_test.go b/pkg/agent/sidecar/config/config_test.go index 849135514e8..2e76361d39b 100644 --- a/pkg/agent/sidecar/config/config_test.go +++ b/pkg/agent/sidecar/config/config_test.go @@ -39,7 +39,7 @@ func TestMode_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -104,7 +104,7 @@ func TestSidecarMode(t *testing.T) { } defaultCheckFunc := func(w want, got Mode) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -176,10 +176,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/agent/sidecar/handler/grpc/handler_test.go b/pkg/agent/sidecar/handler/grpc/handler_test.go index 81ebd95bbe4..f971be02bba 100644 --- a/pkg/agent/sidecar/handler/grpc/handler_test.go +++ b/pkg/agent/sidecar/handler/grpc/handler_test.go @@ -43,7 +43,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got sidecar.SidecarServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/sidecar/handler/grpc/option_test.go b/pkg/agent/sidecar/handler/grpc/option_test.go index a22401e8f91..144315ddc10 100644 --- a/pkg/agent/sidecar/handler/grpc/option_test.go +++ b/pkg/agent/sidecar/handler/grpc/option_test.go @@ -49,10 +49,10 @@ func TestWithStorageObserver(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithStorageObserver(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/sidecar/handler/rest/handler_test.go b/pkg/agent/sidecar/handler/rest/handler_test.go index 8fc6c65f7f1..8c9a341b8f3 100644 --- a/pkg/agent/sidecar/handler/rest/handler_test.go +++ b/pkg/agent/sidecar/handler/rest/handler_test.go @@ -44,7 +44,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -121,10 +121,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/sidecar/handler/rest/option_test.go b/pkg/agent/sidecar/handler/rest/option_test.go index 17c17ecd993..41c5a4a04b0 100644 --- a/pkg/agent/sidecar/handler/rest/option_test.go +++ b/pkg/agent/sidecar/handler/rest/option_test.go @@ -49,10 +49,10 @@ func TestWithSidecar(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithSidecar(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/sidecar/router/option_test.go b/pkg/agent/sidecar/router/option_test.go index 2edd4edb86b..e0788a690d1 100644 --- a/pkg/agent/sidecar/router/option_test.go +++ b/pkg/agent/sidecar/router/option_test.go @@ -50,10 +50,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/agent/sidecar/router/router_test.go b/pkg/agent/sidecar/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/agent/sidecar/router/router_test.go +++ b/pkg/agent/sidecar/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/agent/sidecar/service/observer/observer_test.go b/pkg/agent/sidecar/service/observer/observer_test.go index db03d23d8ce..f5f8aea1de2 100644 --- a/pkg/agent/sidecar/service/observer/observer_test.go +++ b/pkg/agent/sidecar/service/observer/observer_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotSo StorageObserver, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotSo, w.wantSo) { - return errors.Errorf("got = %v, want %v", gotSo, w.wantSo) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotSo, w.wantSo) } return nil } @@ -136,10 +136,10 @@ func Test_observer_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -259,7 +259,7 @@ func Test_observer_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -380,10 +380,10 @@ func Test_observer_startTicker(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -504,10 +504,10 @@ func Test_observer_startBackupLoop(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -628,7 +628,7 @@ func Test_observer_onWrite(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -751,7 +751,7 @@ func Test_observer_onCreate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -873,10 +873,10 @@ func Test_observer_isValidMetadata(t *testing.T) { } defaultCheckFunc := func(w want, got bool, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -990,7 +990,7 @@ func Test_observer_terminate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1104,7 +1104,7 @@ func Test_observer_requestBackup(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1224,7 +1224,7 @@ func Test_observer_backup(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/sidecar/service/observer/option_test.go b/pkg/agent/sidecar/service/observer/option_test.go index 6bebf5c0161..f8a4c1b79b7 100644 --- a/pkg/agent/sidecar/service/observer/option_test.go +++ b/pkg/agent/sidecar/service/observer/option_test.go @@ -51,10 +51,10 @@ func TestWithBackupDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithBackupDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -165,10 +165,10 @@ func TestWithPostStopTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithPostStopTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -279,10 +279,10 @@ func TestWithWatch(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -292,7 +292,7 @@ func TestWithWatch(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -393,10 +393,10 @@ func TestWithTicker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -406,7 +406,7 @@ func TestWithTicker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -507,10 +507,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -520,7 +520,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -621,10 +621,10 @@ func TestWithDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -634,7 +634,7 @@ func TestWithDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -735,10 +735,10 @@ func TestWithBlobStorage(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -748,7 +748,7 @@ func TestWithBlobStorage(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/pkg/agent/sidecar/service/restorer/option_test.go b/pkg/agent/sidecar/service/restorer/option_test.go index da67f1e1e92..4058bf8a4e6 100644 --- a/pkg/agent/sidecar/service/restorer/option_test.go +++ b/pkg/agent/sidecar/service/restorer/option_test.go @@ -52,10 +52,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -166,10 +166,10 @@ func TestWithDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -179,7 +179,7 @@ func TestWithDir(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -280,10 +280,10 @@ func TestWithBlobStorage(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -293,7 +293,7 @@ func TestWithBlobStorage(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -394,10 +394,10 @@ func TestWithBackoffOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -407,7 +407,7 @@ func TestWithBackoffOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/pkg/agent/sidecar/service/restorer/restorer_test.go b/pkg/agent/sidecar/service/restorer/restorer_test.go index 1e6ac33cd82..1aac99ea625 100644 --- a/pkg/agent/sidecar/service/restorer/restorer_test.go +++ b/pkg/agent/sidecar/service/restorer/restorer_test.go @@ -47,10 +47,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Restorer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func Test_restorer_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -229,10 +229,10 @@ func Test_restorer_startRestore(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -328,7 +328,7 @@ func Test_restorer_restore(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/sidecar/service/storage/option_test.go b/pkg/agent/sidecar/service/storage/option_test.go index 04e35e33c13..36be9a663cf 100644 --- a/pkg/agent/sidecar/service/storage/option_test.go +++ b/pkg/agent/sidecar/service/storage/option_test.go @@ -52,10 +52,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -166,10 +166,10 @@ func TestWithType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -179,7 +179,7 @@ func TestWithType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -280,10 +280,10 @@ func TestWithBucketName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -293,7 +293,7 @@ func TestWithBucketName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -394,10 +394,10 @@ func TestWithFilename(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -407,7 +407,7 @@ func TestWithFilename(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -508,10 +508,10 @@ func TestWithFilenameSuffix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -521,7 +521,7 @@ func TestWithFilenameSuffix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -622,10 +622,10 @@ func TestWithS3Opts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -635,7 +635,7 @@ func TestWithS3Opts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -736,10 +736,10 @@ func TestWithS3SessionOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -749,7 +749,7 @@ func TestWithS3SessionOpts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -850,10 +850,10 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -863,7 +863,7 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -964,10 +964,10 @@ func TestWithCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -977,7 +977,7 @@ func TestWithCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } diff --git a/pkg/agent/sidecar/service/storage/storage_test.go b/pkg/agent/sidecar/service/storage/storage_test.go index 66ceb861143..6dffb4ba9db 100644 --- a/pkg/agent/sidecar/service/storage/storage_test.go +++ b/pkg/agent/sidecar/service/storage/storage_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Storage, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -134,7 +134,7 @@ func Test_bs_initCompressor(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -248,7 +248,7 @@ func Test_bs_initBucket(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -367,10 +367,10 @@ func Test_bs_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -495,10 +495,10 @@ func Test_bs_Reader(t *testing.T) { } defaultCheckFunc := func(w want, gotR io.ReadCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -623,10 +623,10 @@ func Test_bs_Writer(t *testing.T) { } defaultCheckFunc := func(w want, gotW io.WriteCloser, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotW, w.wantW) { - return errors.Errorf("got = %v, want %v", gotW, w.wantW) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotW, w.wantW) } return nil } diff --git a/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go b/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go index b40b5574f1f..79e7d5b89fd 100644 --- a/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go +++ b/pkg/agent/sidecar/usecase/initcontainer/initcontainer_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -131,7 +131,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -232,10 +232,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -335,7 +335,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -435,7 +435,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -535,7 +535,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go b/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go index a5ebda8915a..004f9434cd0 100644 --- a/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go +++ b/pkg/agent/sidecar/usecase/sidecar/sidecar_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -131,7 +131,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -232,10 +232,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -335,7 +335,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -435,7 +435,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -535,7 +535,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/agent/sidecar/usecase/sidecard_test.go b/pkg/agent/sidecar/usecase/sidecard_test.go index 4246b5f4799..f9648fdd663 100644 --- a/pkg/agent/sidecar/usecase/sidecard_test.go +++ b/pkg/agent/sidecar/usecase/sidecard_test.go @@ -44,10 +44,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } diff --git a/pkg/discoverer/k8s/config/config_test.go b/pkg/discoverer/k8s/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/discoverer/k8s/config/config_test.go +++ b/pkg/discoverer/k8s/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/discoverer/k8s/handler/grpc/handler_test.go b/pkg/discoverer/k8s/handler/grpc/handler_test.go index a1707df5678..bc4b53707aa 100644 --- a/pkg/discoverer/k8s/handler/grpc/handler_test.go +++ b/pkg/discoverer/k8s/handler/grpc/handler_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotDs DiscovererServer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotDs, w.wantDs) { - return errors.Errorf("got = %v, want %v", gotDs, w.wantDs) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDs, w.wantDs) } return nil } @@ -212,10 +212,10 @@ func Test_server_Pods(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Info_Pods, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -307,10 +307,10 @@ func Test_server_Nodes(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Info_Nodes, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -396,7 +396,7 @@ func Test_singleflightKey(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/discoverer/k8s/handler/grpc/option_test.go b/pkg/discoverer/k8s/handler/grpc/option_test.go index dbbaf014081..d21352516d1 100644 --- a/pkg/discoverer/k8s/handler/grpc/option_test.go +++ b/pkg/discoverer/k8s/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/handler/rest/handler_test.go b/pkg/discoverer/k8s/handler/rest/handler_test.go index 3d13930f8f8..15f1975d12d 100644 --- a/pkg/discoverer/k8s/handler/rest/handler_test.go +++ b/pkg/discoverer/k8s/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Pods(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -304,10 +304,10 @@ func Test_handler_Nodes(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } diff --git a/pkg/discoverer/k8s/handler/rest/option_test.go b/pkg/discoverer/k8s/handler/rest/option_test.go index d83836cd00d..5b5f46f2ffa 100644 --- a/pkg/discoverer/k8s/handler/rest/option_test.go +++ b/pkg/discoverer/k8s/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/router/option_test.go b/pkg/discoverer/k8s/router/option_test.go index 3ae72f2e838..8d2561c8e03 100644 --- a/pkg/discoverer/k8s/router/option_test.go +++ b/pkg/discoverer/k8s/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/router/router_test.go b/pkg/discoverer/k8s/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/discoverer/k8s/router/router_test.go +++ b/pkg/discoverer/k8s/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/discoverer/k8s/service/discover_test.go b/pkg/discoverer/k8s/service/discover_test.go index 8326e3343f4..874c6c56590 100644 --- a/pkg/discoverer/k8s/service/discover_test.go +++ b/pkg/discoverer/k8s/service/discover_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotDsc Discoverer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotDsc, w.wantDsc) { - return errors.Errorf("got = %v, want %v", gotDsc, w.wantDsc) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDsc, w.wantDsc) } return nil } @@ -142,10 +142,10 @@ func Test_discoverer_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -282,10 +282,10 @@ func Test_discoverer_GetPods(t *testing.T) { } defaultCheckFunc := func(w want, gotPods *payload.Info_Pods, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotPods, w.wantPods) { - return errors.Errorf("got = %v, want %v", gotPods, w.wantPods) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotPods, w.wantPods) } return nil } @@ -422,10 +422,10 @@ func Test_discoverer_GetNodes(t *testing.T) { } defaultCheckFunc := func(w want, gotNodes *payload.Info_Nodes, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotNodes, w.wantNodes) { - return errors.Errorf("got = %v, want %v", gotNodes, w.wantNodes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotNodes, w.wantNodes) } return nil } diff --git a/pkg/discoverer/k8s/service/nodemap_test.go b/pkg/discoverer/k8s/service/nodemap_test.go index 382cc3e3ea1..6acd6f184c5 100644 --- a/pkg/discoverer/k8s/service/nodemap_test.go +++ b/pkg/discoverer/k8s/service/nodemap_test.go @@ -44,7 +44,7 @@ func Test_newEntryNodeMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryNodeMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_nodeMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue node.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryNodeMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue node.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryNodeMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual node.Node, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual node.Node, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryNodeMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/discoverer/k8s/service/nodemetricsmap_test.go b/pkg/discoverer/k8s/service/nodemetricsmap_test.go index 04ad7d084fa..b9cbb6b4eaf 100644 --- a/pkg/discoverer/k8s/service/nodemetricsmap_test.go +++ b/pkg/discoverer/k8s/service/nodemetricsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryNodeMetricsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_nodeMetricsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mnode.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mnode.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mnode.Node, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mnode.Node, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/discoverer/k8s/service/option_test.go b/pkg/discoverer/k8s/service/option_test.go index 5a90e39b5f1..5ca1c52e427 100644 --- a/pkg/discoverer/k8s/service/option_test.go +++ b/pkg/discoverer/k8s/service/option_test.go @@ -50,10 +50,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithDiscoverDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithDiscoverDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/service/podmetricsmap_test.go b/pkg/discoverer/k8s/service/podmetricsmap_test.go index 75349d70959..4ab895d5d9e 100644 --- a/pkg/discoverer/k8s/service/podmetricsmap_test.go +++ b/pkg/discoverer/k8s/service/podmetricsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryPodMetricsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryPodMetricsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_podMetricsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mpod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryPodMetricsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mpod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mpod.Pod, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mpod.Pod, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/discoverer/k8s/service/podsmap_test.go b/pkg/discoverer/k8s/service/podsmap_test.go index 8bf5218c51a..48af895d603 100644 --- a/pkg/discoverer/k8s/service/podsmap_test.go +++ b/pkg/discoverer/k8s/service/podsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryPodsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryPodsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_podsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue []pod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryPodsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue []pod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryPodsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_podsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual []pod.Pod, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual []pod.Pod, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryPodsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/discoverer/k8s/usecase/discovered_test.go b/pkg/discoverer/k8s/usecase/discovered_test.go index 351f0093c24..c932c293a75 100644 --- a/pkg/discoverer/k8s/usecase/discovered_test.go +++ b/pkg/discoverer/k8s/usecase/discovered_test.go @@ -51,10 +51,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -134,7 +134,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -239,10 +239,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -346,7 +346,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -450,7 +450,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -554,7 +554,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/gateway/vald/config/config_test.go b/pkg/gateway/vald/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/gateway/vald/config/config_test.go +++ b/pkg/gateway/vald/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/gateway/vald/handler/grpc/checklist_test.go b/pkg/gateway/vald/handler/grpc/checklist_test.go index 805308ea276..11fbb7d4dbe 100644 --- a/pkg/gateway/vald/handler/grpc/checklist_test.go +++ b/pkg/gateway/vald/handler/grpc/checklist_test.go @@ -50,7 +50,7 @@ func Test_checkList_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -232,7 +232,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -311,7 +311,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -544,7 +544,7 @@ func Test_entryCheckList_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/gateway/vald/handler/grpc/handler_test.go b/pkg/gateway/vald/handler/grpc/handler_test.go index b2d6bb98979..fd154bff7e2 100644 --- a/pkg/gateway/vald/handler/grpc/handler_test.go +++ b/pkg/gateway/vald/handler/grpc/handler_test.go @@ -51,7 +51,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got vald.ValdServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -135,10 +135,10 @@ func Test_server_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Object_ID, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -254,10 +254,10 @@ func Test_server_Search(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -373,10 +373,10 @@ func Test_server_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -493,10 +493,10 @@ func Test_server_search(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -612,7 +612,7 @@ func Test_server_StreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -724,7 +724,7 @@ func Test_server_StreamSearchByID(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -838,10 +838,10 @@ func Test_server_Insert(t *testing.T) { } defaultCheckFunc := func(w want, gotCe *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCe, w.wantCe) { - return errors.Errorf("got = %v, want %v", gotCe, w.wantCe) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCe, w.wantCe) } return nil } @@ -955,7 +955,7 @@ func Test_server_StreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1069,10 +1069,10 @@ func Test_server_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1188,10 +1188,10 @@ func Test_server_Update(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1305,7 +1305,7 @@ func Test_server_StreamUpdate(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1419,10 +1419,10 @@ func Test_server_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -1538,10 +1538,10 @@ func Test_server_Upsert(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1655,7 +1655,7 @@ func Test_server_StreamUpsert(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1769,10 +1769,10 @@ func Test_server_MultiUpsert(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1888,10 +1888,10 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -2005,7 +2005,7 @@ func Test_server_StreamRemove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -2119,10 +2119,10 @@ func Test_server_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -2238,10 +2238,10 @@ func Test_server_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotVec *payload.Backup_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -2355,7 +2355,7 @@ func Test_server_StreamGetObject(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/gateway/vald/handler/grpc/option_test.go b/pkg/gateway/vald/handler/grpc/option_test.go index fe13634e257..a4d263cb89f 100644 --- a/pkg/gateway/vald/handler/grpc/option_test.go +++ b/pkg/gateway/vald/handler/grpc/option_test.go @@ -51,10 +51,10 @@ func TestWithGateway(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithGateway(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -390,10 +390,10 @@ func TestWithFilters(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -403,7 +403,7 @@ func TestWithFilters(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -503,10 +503,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -516,7 +516,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -616,10 +616,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -629,7 +629,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -729,10 +729,10 @@ func TestWithReplicationCount(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -742,7 +742,7 @@ func TestWithReplicationCount(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -842,10 +842,10 @@ func TestWithStreamConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -855,7 +855,7 @@ func TestWithStreamConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/handler/rest/handler_test.go b/pkg/gateway/vald/handler/rest/handler_test.go index 37fee9c24f7..003b072ffe6 100644 --- a/pkg/gateway/vald/handler/rest/handler_test.go +++ b/pkg/gateway/vald/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Search(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -304,10 +304,10 @@ func Test_handler_SearchByID(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -395,10 +395,10 @@ func Test_handler_Insert(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -486,10 +486,10 @@ func Test_handler_MultiInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -577,10 +577,10 @@ func Test_handler_Update(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -668,10 +668,10 @@ func Test_handler_MultiUpdate(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -759,10 +759,10 @@ func Test_handler_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -850,10 +850,10 @@ func Test_handler_MultiRemove(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -941,10 +941,10 @@ func Test_handler_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } @@ -1032,10 +1032,10 @@ func Test_handler_Exists(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } diff --git a/pkg/gateway/vald/handler/rest/option_test.go b/pkg/gateway/vald/handler/rest/option_test.go index 3f900a77c5c..9de0b93da79 100644 --- a/pkg/gateway/vald/handler/rest/option_test.go +++ b/pkg/gateway/vald/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithVald(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithVald(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/router/option_test.go b/pkg/gateway/vald/router/option_test.go index a0ea7402dde..d5106a618c7 100644 --- a/pkg/gateway/vald/router/option_test.go +++ b/pkg/gateway/vald/router/option_test.go @@ -50,10 +50,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/router/router_test.go b/pkg/gateway/vald/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/gateway/vald/router/router_test.go +++ b/pkg/gateway/vald/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/gateway/vald/service/backup_option_test.go b/pkg/gateway/vald/service/backup_option_test.go index ca7bca08cf7..afbfe38f588 100644 --- a/pkg/gateway/vald/service/backup_option_test.go +++ b/pkg/gateway/vald/service/backup_option_test.go @@ -50,10 +50,10 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithBackupClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithBackupClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/backup_test.go b/pkg/gateway/vald/service/backup_test.go index 2d6c262f692..0d0b85d3f99 100644 --- a/pkg/gateway/vald/service/backup_test.go +++ b/pkg/gateway/vald/service/backup_test.go @@ -46,10 +46,10 @@ func TestNewBackup(t *testing.T) { } defaultCheckFunc := func(w want, gotBu Backup, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotBu, w.wantBu) { - return errors.Errorf("got = %v, want %v", gotBu, w.wantBu) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotBu, w.wantBu) } return nil } @@ -126,10 +126,10 @@ func Test_backup_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -219,10 +219,10 @@ func Test_backup_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotVec *payload.Backup_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -314,10 +314,10 @@ func Test_backup_GetLocation(t *testing.T) { } defaultCheckFunc := func(w want, gotIpList []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIpList, w.wantIpList) { - return errors.Errorf("got = %v, want %v", gotIpList, w.wantIpList) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIpList, w.wantIpList) } return nil } @@ -408,7 +408,7 @@ func Test_backup_Register(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -499,7 +499,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -590,7 +590,7 @@ func Test_backup_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -681,7 +681,7 @@ func Test_backup_RemoveMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/gateway/vald/service/filter_option_test.go b/pkg/gateway/vald/service/filter_option_test.go index 80e30f9c0d3..a2259407e2e 100644 --- a/pkg/gateway/vald/service/filter_option_test.go +++ b/pkg/gateway/vald/service/filter_option_test.go @@ -50,10 +50,10 @@ func TestWithFilterClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithFilterClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/filter_test.go b/pkg/gateway/vald/service/filter_test.go index e03f77c8214..e5aff94911b 100644 --- a/pkg/gateway/vald/service/filter_test.go +++ b/pkg/gateway/vald/service/filter_test.go @@ -46,10 +46,10 @@ func TestNewFilter(t *testing.T) { } defaultCheckFunc := func(w want, gotEf Filter, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotEf, w.wantEf) { - return errors.Errorf("got = %v, want %v", gotEf, w.wantEf) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotEf, w.wantEf) } return nil } @@ -125,10 +125,10 @@ func Test_filter_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -214,10 +214,10 @@ func Test_filter_FilterSearch(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Search_Response, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/gateway/vald/service/gateway_option_test.go b/pkg/gateway/vald/service/gateway_option_test.go index 7a4c8cea021..2f186c5613e 100644 --- a/pkg/gateway/vald/service/gateway_option_test.go +++ b/pkg/gateway/vald/service/gateway_option_test.go @@ -51,10 +51,10 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/gateway_test.go b/pkg/gateway/vald/service/gateway_test.go index b2592a62b00..e2e583ac565 100644 --- a/pkg/gateway/vald/service/gateway_test.go +++ b/pkg/gateway/vald/service/gateway_test.go @@ -49,10 +49,10 @@ func TestNewGateway(t *testing.T) { } defaultCheckFunc := func(w want, gotGw Gateway, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotGw, w.wantGw) { - return errors.Errorf("got = %v, want %v", gotGw, w.wantGw) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotGw, w.wantGw) } return nil } @@ -129,10 +129,10 @@ func Test_gateway_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -221,7 +221,7 @@ func Test_gateway_BroadCast(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -312,7 +312,7 @@ func Test_gateway_Do(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -404,7 +404,7 @@ func Test_gateway_DoMulti(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -496,7 +496,7 @@ func Test_gateway_GetAgentCount(t *testing.T) { } defaultCheckFunc := func(w want, got int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/gateway/vald/service/meta_option_test.go b/pkg/gateway/vald/service/meta_option_test.go index 4aa31369999..49a6bb8a63e 100644 --- a/pkg/gateway/vald/service/meta_option_test.go +++ b/pkg/gateway/vald/service/meta_option_test.go @@ -51,10 +51,10 @@ func TestWithMetaAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithMetaAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -165,10 +165,10 @@ func TestWithMetaHostPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithMetaHostPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -280,10 +280,10 @@ func TestWithMetaClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -293,7 +293,7 @@ func TestWithMetaClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -393,10 +393,10 @@ func TestWithMetaCacheEnabled(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -406,7 +406,7 @@ func TestWithMetaCacheEnabled(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -506,10 +506,10 @@ func TestWithMetaCache(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -519,7 +519,7 @@ func TestWithMetaCache(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -619,10 +619,10 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -632,7 +632,7 @@ func TestWithMetaCacheExpireDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -732,10 +732,10 @@ func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -745,7 +745,7 @@ func TestWithMetaCacheExpiredCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/meta_test.go b/pkg/gateway/vald/service/meta_test.go index c2d0835a8ac..8314fe1becb 100644 --- a/pkg/gateway/vald/service/meta_test.go +++ b/pkg/gateway/vald/service/meta_test.go @@ -47,10 +47,10 @@ func TestNewMeta(t *testing.T) { } defaultCheckFunc := func(w want, gotMi Meta, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMi, w.wantMi) { - return errors.Errorf("got = %v, want %v", gotMi, w.wantMi) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMi, w.wantMi) } return nil } @@ -131,10 +131,10 @@ func Test_meta_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -240,10 +240,10 @@ func Test_meta_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got bool, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -351,10 +351,10 @@ func Test_meta_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, gotV string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotV, w.wantV) { - return errors.Errorf("got = %v, want %v", gotV, w.wantV) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotV, w.wantV) } return nil } @@ -462,10 +462,10 @@ func Test_meta_GetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -573,10 +573,10 @@ func Test_meta_GetUUID(t *testing.T) { } defaultCheckFunc := func(w want, gotK string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotK, w.wantK) { - return errors.Errorf("got = %v, want %v", gotK, w.wantK) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotK, w.wantK) } return nil } @@ -684,10 +684,10 @@ func Test_meta_GetUUIDs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -795,7 +795,7 @@ func Test_meta_SetUUIDandMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -904,7 +904,7 @@ func Test_meta_SetUUIDandMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1012,10 +1012,10 @@ func Test_meta_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, gotV string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotV, w.wantV) { - return errors.Errorf("got = %v, want %v", gotV, w.wantV) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotV, w.wantV) } return nil } @@ -1123,10 +1123,10 @@ func Test_meta_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1234,10 +1234,10 @@ func Test_meta_DeleteUUID(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1345,10 +1345,10 @@ func Test_meta_DeleteUUIDs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/gateway/vald/usecase/vald_test.go b/pkg/gateway/vald/usecase/vald_test.go index 542bbff2a99..0ddf94e159a 100644 --- a/pkg/gateway/vald/usecase/vald_test.go +++ b/pkg/gateway/vald/usecase/vald_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -135,7 +135,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -248,10 +248,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -363,7 +363,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -475,7 +475,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -587,7 +587,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/backup/cassandra/config/config_test.go b/pkg/manager/backup/cassandra/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/backup/cassandra/config/config_test.go +++ b/pkg/manager/backup/cassandra/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/backup/cassandra/handler/grpc/handler_test.go b/pkg/manager/backup/cassandra/handler/grpc/handler_test.go index 456f2137712..4597be7907c 100644 --- a/pkg/manager/backup/cassandra/handler/grpc/handler_test.go +++ b/pkg/manager/backup/cassandra/handler/grpc/handler_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,10 +124,10 @@ func Test_server_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Backup_Compressed_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -215,10 +215,10 @@ func Test_server_Locations(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Info_IPs, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -306,10 +306,10 @@ func Test_server_Register(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -397,10 +397,10 @@ func Test_server_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -488,10 +488,10 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -579,10 +579,10 @@ func Test_server_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -670,10 +670,10 @@ func Test_server_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -761,10 +761,10 @@ func Test_server_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -847,10 +847,10 @@ func Test_toBackupMetaVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Backup_Compressed_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -922,10 +922,10 @@ func Test_toModelMetaVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *model.MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/manager/backup/cassandra/handler/grpc/option_test.go b/pkg/manager/backup/cassandra/handler/grpc/option_test.go index 21a09c41983..8fb1738595f 100644 --- a/pkg/manager/backup/cassandra/handler/grpc/option_test.go +++ b/pkg/manager/backup/cassandra/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/cassandra/handler/rest/handler_test.go b/pkg/manager/backup/cassandra/handler/rest/handler_test.go index 02c6cbd3b27..ba4ee31ee88 100644 --- a/pkg/manager/backup/cassandra/handler/rest/handler_test.go +++ b/pkg/manager/backup/cassandra/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Locations(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_Register(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_handler_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -486,10 +486,10 @@ func Test_handler_Remove(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -577,10 +577,10 @@ func Test_handler_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -668,10 +668,10 @@ func Test_handler_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -759,10 +759,10 @@ func Test_handler_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/backup/cassandra/handler/rest/option_test.go b/pkg/manager/backup/cassandra/handler/rest/option_test.go index b5d36178428..35ff83bc445 100644 --- a/pkg/manager/backup/cassandra/handler/rest/option_test.go +++ b/pkg/manager/backup/cassandra/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/cassandra/router/option_test.go b/pkg/manager/backup/cassandra/router/option_test.go index 1d2af22405a..b347818b1e8 100644 --- a/pkg/manager/backup/cassandra/router/option_test.go +++ b/pkg/manager/backup/cassandra/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/cassandra/router/router_test.go b/pkg/manager/backup/cassandra/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/backup/cassandra/router/router_test.go +++ b/pkg/manager/backup/cassandra/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/backup/cassandra/service/cassandra_test.go b/pkg/manager/backup/cassandra/service/cassandra_test.go index e0bf5283be7..62f5fa46ed9 100644 --- a/pkg/manager/backup/cassandra/service/cassandra_test.go +++ b/pkg/manager/backup/cassandra/service/cassandra_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Cassandra, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,7 +124,7 @@ func Test_client_Connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -212,7 +212,7 @@ func Test_client_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -302,10 +302,10 @@ func Test_client_getMetaVector(t *testing.T) { } defaultCheckFunc := func(w want, got *model.MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -397,10 +397,10 @@ func Test_client_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *model.MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -492,10 +492,10 @@ func Test_client_GetIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -586,7 +586,7 @@ func Test_client_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -677,7 +677,7 @@ func Test_client_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -768,7 +768,7 @@ func Test_client_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -859,7 +859,7 @@ func Test_client_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -951,7 +951,7 @@ func Test_client_SetIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1044,7 +1044,7 @@ func Test_client_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/backup/cassandra/usecase/backupd_test.go b/pkg/manager/backup/cassandra/usecase/backupd_test.go index 1267815ef27..6ebfc3ad32f 100644 --- a/pkg/manager/backup/cassandra/usecase/backupd_test.go +++ b/pkg/manager/backup/cassandra/usecase/backupd_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/backup/mysql/config/config_test.go b/pkg/manager/backup/mysql/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/backup/mysql/config/config_test.go +++ b/pkg/manager/backup/mysql/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/backup/mysql/handler/grpc/handler_test.go b/pkg/manager/backup/mysql/handler/grpc/handler_test.go index 230c9c9c27b..b08c1f09903 100644 --- a/pkg/manager/backup/mysql/handler/grpc/handler_test.go +++ b/pkg/manager/backup/mysql/handler/grpc/handler_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,10 +124,10 @@ func Test_server_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Backup_Compressed_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -215,10 +215,10 @@ func Test_server_Locations(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Info_IPs, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -306,10 +306,10 @@ func Test_server_Register(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -397,10 +397,10 @@ func Test_server_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -488,10 +488,10 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -579,10 +579,10 @@ func Test_server_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -670,10 +670,10 @@ func Test_server_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -761,10 +761,10 @@ func Test_server_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -847,10 +847,10 @@ func Test_toBackupMetaVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Backup_Compressed_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -922,10 +922,10 @@ func Test_toModelMetaVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *model.MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/manager/backup/mysql/handler/grpc/option_test.go b/pkg/manager/backup/mysql/handler/grpc/option_test.go index d124bdd8100..3cf5e136e62 100644 --- a/pkg/manager/backup/mysql/handler/grpc/option_test.go +++ b/pkg/manager/backup/mysql/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithMySQL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithMySQL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/mysql/handler/rest/handler_test.go b/pkg/manager/backup/mysql/handler/rest/handler_test.go index 02c6cbd3b27..ba4ee31ee88 100644 --- a/pkg/manager/backup/mysql/handler/rest/handler_test.go +++ b/pkg/manager/backup/mysql/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Locations(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_Register(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_handler_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -486,10 +486,10 @@ func Test_handler_Remove(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -577,10 +577,10 @@ func Test_handler_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -668,10 +668,10 @@ func Test_handler_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -759,10 +759,10 @@ func Test_handler_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/backup/mysql/handler/rest/option_test.go b/pkg/manager/backup/mysql/handler/rest/option_test.go index b5d36178428..35ff83bc445 100644 --- a/pkg/manager/backup/mysql/handler/rest/option_test.go +++ b/pkg/manager/backup/mysql/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/mysql/model/model_test.go b/pkg/manager/backup/mysql/model/model_test.go index 2e9181638c4..58c1812c626 100644 --- a/pkg/manager/backup/mysql/model/model_test.go +++ b/pkg/manager/backup/mysql/model/model_test.go @@ -44,7 +44,7 @@ func TestMetaVector_GetUUID(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,7 +129,7 @@ func TestMetaVector_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got []byte) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -214,7 +214,7 @@ func TestMetaVector_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -299,7 +299,7 @@ func TestMetaVector_GetIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/backup/mysql/router/option_test.go b/pkg/manager/backup/mysql/router/option_test.go index 1dc61e54adf..98f78f74226 100644 --- a/pkg/manager/backup/mysql/router/option_test.go +++ b/pkg/manager/backup/mysql/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/backup/mysql/router/router_test.go b/pkg/manager/backup/mysql/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/backup/mysql/router/router_test.go +++ b/pkg/manager/backup/mysql/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/backup/mysql/service/mysql_test.go b/pkg/manager/backup/mysql/service/mysql_test.go index a733841e585..000f3ab8c2b 100644 --- a/pkg/manager/backup/mysql/service/mysql_test.go +++ b/pkg/manager/backup/mysql/service/mysql_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotMs MySQL, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMs, w.wantMs) { - return errors.Errorf("got = %v, want %v", gotMs, w.wantMs) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMs, w.wantMs) } return nil } @@ -123,7 +123,7 @@ func Test_client_Connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -207,7 +207,7 @@ func Test_client_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -293,10 +293,10 @@ func Test_client_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *model.MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -384,10 +384,10 @@ func Test_client_GetIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -474,7 +474,7 @@ func Test_client_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -561,7 +561,7 @@ func Test_client_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -648,7 +648,7 @@ func Test_client_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -735,7 +735,7 @@ func Test_client_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -823,7 +823,7 @@ func Test_client_SetIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -912,7 +912,7 @@ func Test_client_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/backup/mysql/usecase/backupd_test.go b/pkg/manager/backup/mysql/usecase/backupd_test.go index 5268dab084c..33233251a05 100644 --- a/pkg/manager/backup/mysql/usecase/backupd_test.go +++ b/pkg/manager/backup/mysql/usecase/backupd_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/compressor/config/config_test.go b/pkg/manager/compressor/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/compressor/config/config_test.go +++ b/pkg/manager/compressor/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/compressor/handler/grpc/handler_test.go b/pkg/manager/compressor/handler/grpc/handler_test.go index f316dc30f3f..21bc2d1adaa 100644 --- a/pkg/manager/compressor/handler/grpc/handler_test.go +++ b/pkg/manager/compressor/handler/grpc/handler_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -125,10 +125,10 @@ func Test_server_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Backup_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -224,10 +224,10 @@ func Test_server_Locations(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Info_IPs, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -323,10 +323,10 @@ func Test_server_Register(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -422,10 +422,10 @@ func Test_server_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -521,10 +521,10 @@ func Test_server_Remove(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -620,10 +620,10 @@ func Test_server_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -719,10 +719,10 @@ func Test_server_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } @@ -818,10 +818,10 @@ func Test_server_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/manager/compressor/handler/grpc/option_test.go b/pkg/manager/compressor/handler/grpc/option_test.go index 9fe91048ce8..501a833156e 100644 --- a/pkg/manager/compressor/handler/grpc/option_test.go +++ b/pkg/manager/compressor/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithRegisterer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithRegisterer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/handler/rest/handler_test.go b/pkg/manager/compressor/handler/rest/handler_test.go index 3fae2ad60dc..d98809f0ffc 100644 --- a/pkg/manager/compressor/handler/rest/handler_test.go +++ b/pkg/manager/compressor/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_GetVector(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Locations(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_Register(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_handler_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -486,10 +486,10 @@ func Test_handler_Remove(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -577,10 +577,10 @@ func Test_handler_RemoveMulti(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -668,10 +668,10 @@ func Test_handler_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -759,10 +759,10 @@ func Test_handler_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/compressor/handler/rest/option_test.go b/pkg/manager/compressor/handler/rest/option_test.go index 3439b09ad93..50c7f54f400 100644 --- a/pkg/manager/compressor/handler/rest/option_test.go +++ b/pkg/manager/compressor/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/router/option_test.go b/pkg/manager/compressor/router/option_test.go index 0669555dbd9..1597eb255ab 100644 --- a/pkg/manager/compressor/router/option_test.go +++ b/pkg/manager/compressor/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/router/router_test.go b/pkg/manager/compressor/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/compressor/router/router_test.go +++ b/pkg/manager/compressor/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/compressor/service/backup_option_test.go b/pkg/manager/compressor/service/backup_option_test.go index ca7bca08cf7..afbfe38f588 100644 --- a/pkg/manager/compressor/service/backup_option_test.go +++ b/pkg/manager/compressor/service/backup_option_test.go @@ -50,10 +50,10 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithBackupClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithBackupClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/backup_test.go b/pkg/manager/compressor/service/backup_test.go index a064bdb6b39..76d0df849ad 100644 --- a/pkg/manager/compressor/service/backup_test.go +++ b/pkg/manager/compressor/service/backup_test.go @@ -46,10 +46,10 @@ func TestNewBackup(t *testing.T) { } defaultCheckFunc := func(w want, gotBu Backup, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotBu, w.wantBu) { - return errors.Errorf("got = %v, want %v", gotBu, w.wantBu) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotBu, w.wantBu) } return nil } @@ -126,10 +126,10 @@ func Test_backup_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -219,10 +219,10 @@ func Test_backup_GetObject(t *testing.T) { } defaultCheckFunc := func(w want, gotVec *payload.Backup_Compressed_MetaVector, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -314,10 +314,10 @@ func Test_backup_GetLocation(t *testing.T) { } defaultCheckFunc := func(w want, gotIpList []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIpList, w.wantIpList) { - return errors.Errorf("got = %v, want %v", gotIpList, w.wantIpList) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIpList, w.wantIpList) } return nil } @@ -408,7 +408,7 @@ func Test_backup_Register(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -499,7 +499,7 @@ func Test_backup_RegisterMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -590,7 +590,7 @@ func Test_backup_Remove(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -681,7 +681,7 @@ func Test_backup_RemoveMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -773,7 +773,7 @@ func Test_backup_RegisterIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -866,7 +866,7 @@ func Test_backup_RemoveIPs(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/compressor/service/compress_option_test.go b/pkg/manager/compressor/service/compress_option_test.go index ba4fc640827..67bc89d160c 100644 --- a/pkg/manager/compressor/service/compress_option_test.go +++ b/pkg/manager/compressor/service/compress_option_test.go @@ -51,10 +51,10 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithCompressorWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithCompressorWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -390,10 +390,10 @@ func TestWithCompressorErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -403,7 +403,7 @@ func TestWithCompressorErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/compress_test.go b/pkg/manager/compressor/service/compress_test.go index ad28e8f39b8..79d07ebae8e 100644 --- a/pkg/manager/compressor/service/compress_test.go +++ b/pkg/manager/compressor/service/compress_test.go @@ -47,10 +47,10 @@ func TestNewCompressor(t *testing.T) { } defaultCheckFunc := func(w want, got Compressor, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -130,7 +130,7 @@ func Test_compressor_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -235,10 +235,10 @@ func Test_compressor_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -344,10 +344,10 @@ func Test_compressor_dispatchCompress(t *testing.T) { } defaultCheckFunc := func(w want, gotResults [][]byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResults, w.wantResults) { - return errors.Errorf("got = %v, want %v", gotResults, w.wantResults) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResults, w.wantResults) } return nil } @@ -455,10 +455,10 @@ func Test_compressor_dispatchDecompress(t *testing.T) { } defaultCheckFunc := func(w want, gotResults [][]float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotResults, w.wantResults) { - return errors.Errorf("got = %v, want %v", gotResults, w.wantResults) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotResults, w.wantResults) } return nil } @@ -566,10 +566,10 @@ func Test_compressor_Compress(t *testing.T) { } defaultCheckFunc := func(w want, got []byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -677,10 +677,10 @@ func Test_compressor_Decompress(t *testing.T) { } defaultCheckFunc := func(w want, got []float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -788,10 +788,10 @@ func Test_compressor_MultiCompress(t *testing.T) { } defaultCheckFunc := func(w want, got [][]byte, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -899,10 +899,10 @@ func Test_compressor_MultiDecompress(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float32, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1004,7 +1004,7 @@ func Test_compressor_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1098,7 +1098,7 @@ func Test_compressor_TotalRequested(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1192,7 +1192,7 @@ func Test_compressor_TotalCompleted(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/compressor/service/registerer_option_test.go b/pkg/manager/compressor/service/registerer_option_test.go index 181276104fe..0fb889e5b38 100644 --- a/pkg/manager/compressor/service/registerer_option_test.go +++ b/pkg/manager/compressor/service/registerer_option_test.go @@ -52,10 +52,10 @@ func TestWithRegistererWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -65,7 +65,7 @@ func TestWithRegistererWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -165,10 +165,10 @@ func TestWithRegistererErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -178,7 +178,7 @@ func TestWithRegistererErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -278,10 +278,10 @@ func TestWithRegistererBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -291,7 +291,7 @@ func TestWithRegistererBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -391,10 +391,10 @@ func TestWithRegistererCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -404,7 +404,7 @@ func TestWithRegistererCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -504,10 +504,10 @@ func TestWithRegistererClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -517,7 +517,7 @@ func TestWithRegistererClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/registerer_test.go b/pkg/manager/compressor/service/registerer_test.go index 03baf420490..3facb7b7115 100644 --- a/pkg/manager/compressor/service/registerer_test.go +++ b/pkg/manager/compressor/service/registerer_test.go @@ -49,10 +49,10 @@ func TestNewRegisterer(t *testing.T) { } defaultCheckFunc := func(w want, got Registerer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -134,7 +134,7 @@ func Test_registerer_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -247,10 +247,10 @@ func Test_registerer_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -362,7 +362,7 @@ func Test_registerer_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -475,7 +475,7 @@ func Test_registerer_Register(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -590,7 +590,7 @@ func Test_registerer_RegisterMulti(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -700,7 +700,7 @@ func Test_registerer_Len(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -802,7 +802,7 @@ func Test_registerer_TotalRequested(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -904,7 +904,7 @@ func Test_registerer_TotalCompleted(t *testing.T) { } defaultCheckFunc := func(w want, got uint64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1011,7 +1011,7 @@ func Test_registerer_dispatch(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1125,7 +1125,7 @@ func Test_registerer_registerProcessFunc(t *testing.T) { } defaultCheckFunc := func(w want, got worker.JobFunc) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1237,7 +1237,7 @@ func Test_registerer_forwardMetas(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/compressor/usecase/compressord_test.go b/pkg/manager/compressor/usecase/compressord_test.go index acf0425cf46..cc195528b63 100644 --- a/pkg/manager/compressor/usecase/compressord_test.go +++ b/pkg/manager/compressor/usecase/compressord_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -134,7 +134,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -243,10 +243,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -354,7 +354,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -462,7 +462,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -570,7 +570,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/index/config/config_test.go b/pkg/manager/index/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/index/config/config_test.go +++ b/pkg/manager/index/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/index/handler/grpc/checklist_test.go b/pkg/manager/index/handler/grpc/checklist_test.go index 805308ea276..11fbb7d4dbe 100644 --- a/pkg/manager/index/handler/grpc/checklist_test.go +++ b/pkg/manager/index/handler/grpc/checklist_test.go @@ -50,7 +50,7 @@ func Test_checkList_Exists(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -232,7 +232,7 @@ func Test_entryCheckList_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -311,7 +311,7 @@ func Test_entryCheckList_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -544,7 +544,7 @@ func Test_entryCheckList_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/index/handler/grpc/handler_test.go b/pkg/manager/index/handler/grpc/handler_test.go index 6931e288626..9f2dbf60508 100644 --- a/pkg/manager/index/handler/grpc/handler_test.go +++ b/pkg/manager/index/handler/grpc/handler_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got index.IndexServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,10 +124,10 @@ func Test_server_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Info_Index_Count, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/manager/index/handler/grpc/option_test.go b/pkg/manager/index/handler/grpc/option_test.go index 6a31db6af88..51c8e68c641 100644 --- a/pkg/manager/index/handler/grpc/option_test.go +++ b/pkg/manager/index/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/index/handler/rest/handler_test.go b/pkg/manager/index/handler/rest/handler_test.go index 5f89220f1c4..a8cc4577398 100644 --- a/pkg/manager/index/handler/rest/handler_test.go +++ b/pkg/manager/index/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_IndexInfo(t *testing.T) { } defaultCheckFunc := func(w want, gotCode int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCode, w.wantCode) { - return errors.Errorf("got = %v, want %v", gotCode, w.wantCode) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCode, w.wantCode) } return nil } diff --git a/pkg/manager/index/handler/rest/option_test.go b/pkg/manager/index/handler/rest/option_test.go index 7397d7d9b72..2fd8467a7fd 100644 --- a/pkg/manager/index/handler/rest/option_test.go +++ b/pkg/manager/index/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/index/router/option_test.go b/pkg/manager/index/router/option_test.go index d3268d211e6..bf0bdb72f5a 100644 --- a/pkg/manager/index/router/option_test.go +++ b/pkg/manager/index/router/option_test.go @@ -50,10 +50,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/index/router/router_test.go b/pkg/manager/index/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/index/router/router_test.go +++ b/pkg/manager/index/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/index/service/indexer_test.go b/pkg/manager/index/service/indexer_test.go index c2c57ce46fb..d2853ba5921 100644 --- a/pkg/manager/index/service/indexer_test.go +++ b/pkg/manager/index/service/indexer_test.go @@ -49,10 +49,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotIdx Indexer, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotIdx, w.wantIdx) { - return errors.Errorf("got = %v, want %v", gotIdx, w.wantIdx) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIdx, w.wantIdx) } return nil } @@ -138,10 +138,10 @@ func Test_index_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -266,7 +266,7 @@ func Test_index_execute(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -392,7 +392,7 @@ func Test_index_loadInfos(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -512,7 +512,7 @@ func Test_index_IsIndexing(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -626,7 +626,7 @@ func Test_index_NumberOfUUIDs(t *testing.T) { } defaultCheckFunc := func(w want, got uint32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -740,7 +740,7 @@ func Test_index_NumberOfUncommittedUUIDs(t *testing.T) { } defaultCheckFunc := func(w want, got uint32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/index/service/indexinfos_test.go b/pkg/manager/index/service/indexinfos_test.go index 9a1bb74a974..deff581bc13 100644 --- a/pkg/manager/index/service/indexinfos_test.go +++ b/pkg/manager/index/service/indexinfos_test.go @@ -44,7 +44,7 @@ func Test_newEntryIndexInfos(t *testing.T) { } defaultCheckFunc := func(w want, got *entryIndexInfos) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_indexInfos_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue *payload.Info_Index_Count, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryIndexInfos_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue *payload.Info_Index_Count, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryIndexInfos_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryIndexInfos_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -707,7 +707,7 @@ func Test_entryIndexInfos_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1030,7 +1030,7 @@ func Test_entryIndexInfos_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/index/service/option_test.go b/pkg/manager/index/service/option_test.go index f15ca1eb4fc..d08aeaba22d 100644 --- a/pkg/manager/index/service/option_test.go +++ b/pkg/manager/index/service/option_test.go @@ -51,10 +51,10 @@ func TestWithIndexingConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithIndexingConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithIndexingDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithIndexingDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithIndexingDurationLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithIndexingDurationLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -390,10 +390,10 @@ func TestWithMinUncommitted(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -403,7 +403,7 @@ func TestWithMinUncommitted(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -503,10 +503,10 @@ func TestWithCreationPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -516,7 +516,7 @@ func TestWithCreationPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -616,10 +616,10 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -629,7 +629,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -729,10 +729,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -742,7 +742,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/index/usecase/indexer_test.go b/pkg/manager/index/usecase/indexer_test.go index ce4317761e8..ec98309dcda 100644 --- a/pkg/manager/index/usecase/indexer_test.go +++ b/pkg/manager/index/usecase/indexer_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/replication/agent/config/config_test.go b/pkg/manager/replication/agent/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/replication/agent/config/config_test.go +++ b/pkg/manager/replication/agent/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/replication/agent/handler/grpc/handler_test.go b/pkg/manager/replication/agent/handler/grpc/handler_test.go index 147ea029ba3..277660ce227 100644 --- a/pkg/manager/replication/agent/handler/grpc/handler_test.go +++ b/pkg/manager/replication/agent/handler/grpc/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Server) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_server_Recover(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_server_Rebalance(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_server_AgentInfo(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Replication_Agents, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/agent/handler/grpc/option_test.go b/pkg/manager/replication/agent/handler/grpc/option_test.go index 0f278cb055f..b10ed94a68f 100644 --- a/pkg/manager/replication/agent/handler/grpc/option_test.go +++ b/pkg/manager/replication/agent/handler/grpc/option_test.go @@ -49,10 +49,10 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -62,7 +62,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/agent/handler/rest/handler_test.go b/pkg/manager/replication/agent/handler/rest/handler_test.go index 8e20a75c577..9c894e10b2c 100644 --- a/pkg/manager/replication/agent/handler/rest/handler_test.go +++ b/pkg/manager/replication/agent/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Recover(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_Rebalance(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_AgentInfo(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/agent/handler/rest/option_test.go b/pkg/manager/replication/agent/handler/rest/option_test.go index b92441a24e7..87f8897ebfd 100644 --- a/pkg/manager/replication/agent/handler/rest/option_test.go +++ b/pkg/manager/replication/agent/handler/rest/option_test.go @@ -51,10 +51,10 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/agent/router/option_test.go b/pkg/manager/replication/agent/router/option_test.go index 5ae48eea0b9..f6eb8577cad 100644 --- a/pkg/manager/replication/agent/router/option_test.go +++ b/pkg/manager/replication/agent/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/agent/router/router_test.go b/pkg/manager/replication/agent/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/replication/agent/router/router_test.go +++ b/pkg/manager/replication/agent/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/agent/service/agent_test.go b/pkg/manager/replication/agent/service/agent_test.go index 0f9e4fb34f4..cada367122c 100644 --- a/pkg/manager/replication/agent/service/agent_test.go +++ b/pkg/manager/replication/agent/service/agent_test.go @@ -37,7 +37,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Replicator) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/agent/usecase/backupd_test.go b/pkg/manager/replication/agent/usecase/backupd_test.go index 93e1516be40..d7ea99b3633 100644 --- a/pkg/manager/replication/agent/usecase/backupd_test.go +++ b/pkg/manager/replication/agent/usecase/backupd_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/replication/controller/config/config_test.go b/pkg/manager/replication/controller/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/manager/replication/controller/config/config_test.go +++ b/pkg/manager/replication/controller/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/manager/replication/controller/handler/grpc/handler_test.go b/pkg/manager/replication/controller/handler/grpc/handler_test.go index bb3f1fbe052..796648e21ed 100644 --- a/pkg/manager/replication/controller/handler/grpc/handler_test.go +++ b/pkg/manager/replication/controller/handler/grpc/handler_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got controller.ReplicationServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,10 +124,10 @@ func Test_server_ReplicationInfo(t *testing.T) { } defaultCheckFunc := func(w want, gotRes *payload.Replication_Agents, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRes, w.wantRes) { - return errors.Errorf("got = %v, want %v", gotRes, w.wantRes) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRes, w.wantRes) } return nil } diff --git a/pkg/manager/replication/controller/handler/grpc/option_test.go b/pkg/manager/replication/controller/handler/grpc/option_test.go index 7c14018f56b..a44aa0b1acb 100644 --- a/pkg/manager/replication/controller/handler/grpc/option_test.go +++ b/pkg/manager/replication/controller/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/controller/handler/rest/handler_test.go b/pkg/manager/replication/controller/handler/rest/handler_test.go index 40e699aad3b..0ac2edcdaa3 100644 --- a/pkg/manager/replication/controller/handler/rest/handler_test.go +++ b/pkg/manager/replication/controller/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/controller/handler/rest/option_test.go b/pkg/manager/replication/controller/handler/rest/option_test.go index 421ccca1ad5..ab779d37349 100644 --- a/pkg/manager/replication/controller/handler/rest/option_test.go +++ b/pkg/manager/replication/controller/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/controller/router/option_test.go b/pkg/manager/replication/controller/router/option_test.go index 86a5027faf1..179c3260b45 100644 --- a/pkg/manager/replication/controller/router/option_test.go +++ b/pkg/manager/replication/controller/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/controller/router/router_test.go b/pkg/manager/replication/controller/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/manager/replication/controller/router/router_test.go +++ b/pkg/manager/replication/controller/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/manager/replication/controller/service/discover_test.go b/pkg/manager/replication/controller/service/discover_test.go index 78053e1cf0d..d71165572ae 100644 --- a/pkg/manager/replication/controller/service/discover_test.go +++ b/pkg/manager/replication/controller/service/discover_test.go @@ -51,10 +51,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotRp Replicator, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotRp, w.wantRp) { - return errors.Errorf("got = %v, want %v", gotRp, w.wantRp) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotRp, w.wantRp) } return nil } @@ -137,10 +137,10 @@ func Test_replicator_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -249,10 +249,10 @@ func Test_replicator_GetCurrentPodIPs(t *testing.T) { } defaultCheckFunc := func(w want, got []string, got1 bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -358,7 +358,7 @@ func Test_replicator_SendRecoveryRequest(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/manager/replication/controller/service/nodemap_test.go b/pkg/manager/replication/controller/service/nodemap_test.go index 382cc3e3ea1..6acd6f184c5 100644 --- a/pkg/manager/replication/controller/service/nodemap_test.go +++ b/pkg/manager/replication/controller/service/nodemap_test.go @@ -44,7 +44,7 @@ func Test_newEntryNodeMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryNodeMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_nodeMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue node.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryNodeMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue node.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryNodeMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryNodeMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_nodeMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual node.Node, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryNodeMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual node.Node, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryNodeMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryNodeMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/replication/controller/service/nodemetricsmap_test.go b/pkg/manager/replication/controller/service/nodemetricsmap_test.go index 04ad7d084fa..b9cbb6b4eaf 100644 --- a/pkg/manager/replication/controller/service/nodemetricsmap_test.go +++ b/pkg/manager/replication/controller/service/nodemetricsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryNodeMetricsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryNodeMetricsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_nodeMetricsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mnode.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryNodeMetricsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mnode.Node, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryNodeMetricsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryNodeMetricsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_nodeMetricsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mnode.Node, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryNodeMetricsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mnode.Node, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryNodeMetricsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryNodeMetricsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/replication/controller/service/option_test.go b/pkg/manager/replication/controller/service/option_test.go index 9c2acb8190b..29b41c524e0 100644 --- a/pkg/manager/replication/controller/service/option_test.go +++ b/pkg/manager/replication/controller/service/option_test.go @@ -50,10 +50,10 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithRecoverCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithRecoverCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/manager/replication/controller/service/podmetricsmap_test.go b/pkg/manager/replication/controller/service/podmetricsmap_test.go index 75349d70959..4ab895d5d9e 100644 --- a/pkg/manager/replication/controller/service/podmetricsmap_test.go +++ b/pkg/manager/replication/controller/service/podmetricsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryPodMetricsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryPodMetricsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_podMetricsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mpod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryPodMetricsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue mpod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryPodMetricsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryPodMetricsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_podMetricsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mpod.Pod, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryPodMetricsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual mpod.Pod, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryPodMetricsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryPodMetricsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/replication/controller/service/podsmap_test.go b/pkg/manager/replication/controller/service/podsmap_test.go index 8bf5218c51a..48af895d603 100644 --- a/pkg/manager/replication/controller/service/podsmap_test.go +++ b/pkg/manager/replication/controller/service/podsmap_test.go @@ -44,7 +44,7 @@ func Test_newEntryPodsMap(t *testing.T) { } defaultCheckFunc := func(w want, got *entryPodsMap) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_podsMap_Load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue []pod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -214,10 +214,10 @@ func Test_entryPodsMap_load(t *testing.T) { } defaultCheckFunc := func(w want, gotValue []pod.Pod, gotOk bool) error { if !reflect.DeepEqual(gotValue, w.wantValue) { - return errors.Errorf("got = %v, want %v", gotValue, w.wantValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotValue, w.wantValue) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -387,7 +387,7 @@ func Test_entryPodsMap_tryStore(t *testing.T) { } defaultCheckFunc := func(w want, got bool) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_entryPodsMap_unexpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotWasExpunged bool) error { if !reflect.DeepEqual(gotWasExpunged, w.wantWasExpunged) { - return errors.Errorf("got = %v, want %v", gotWasExpunged, w.wantWasExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotWasExpunged, w.wantWasExpunged) } return nil } @@ -626,10 +626,10 @@ func Test_podsMap_LoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual []pod.Pod, gotLoaded bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } return nil } @@ -725,13 +725,13 @@ func Test_entryPodsMap_tryLoadOrStore(t *testing.T) { } defaultCheckFunc := func(w want, gotActual []pod.Pod, gotLoaded bool, gotOk bool) error { if !reflect.DeepEqual(gotActual, w.wantActual) { - return errors.Errorf("got = %v, want %v", gotActual, w.wantActual) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotActual, w.wantActual) } if !reflect.DeepEqual(gotLoaded, w.wantLoaded) { - return errors.Errorf("got = %v, want %v", gotLoaded, w.wantLoaded) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotLoaded, w.wantLoaded) } if !reflect.DeepEqual(gotOk, w.wantOk) { - return errors.Errorf("got = %v, want %v", gotOk, w.wantOk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotOk, w.wantOk) } return nil } @@ -900,7 +900,7 @@ func Test_entryPodsMap_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotHadValue bool) error { if !reflect.DeepEqual(gotHadValue, w.wantHadValue) { - return errors.Errorf("got = %v, want %v", gotHadValue, w.wantHadValue) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotHadValue, w.wantHadValue) } return nil } @@ -1223,7 +1223,7 @@ func Test_entryPodsMap_tryExpungeLocked(t *testing.T) { } defaultCheckFunc := func(w want, gotIsExpunged bool) error { if !reflect.DeepEqual(gotIsExpunged, w.wantIsExpunged) { - return errors.Errorf("got = %v, want %v", gotIsExpunged, w.wantIsExpunged) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIsExpunged, w.wantIsExpunged) } return nil } diff --git a/pkg/manager/replication/controller/usecase/discovered_test.go b/pkg/manager/replication/controller/usecase/discovered_test.go index ef16f551620..09fa796e28d 100644 --- a/pkg/manager/replication/controller/usecase/discovered_test.go +++ b/pkg/manager/replication/controller/usecase/discovered_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/meta/cassandra/config/config_test.go b/pkg/meta/cassandra/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/meta/cassandra/config/config_test.go +++ b/pkg/meta/cassandra/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/meta/cassandra/handler/grpc/handler_test.go b/pkg/meta/cassandra/handler/grpc/handler_test.go index b38159ffc07..23837f76108 100644 --- a/pkg/meta/cassandra/handler/grpc/handler_test.go +++ b/pkg/meta/cassandra/handler/grpc/handler_test.go @@ -47,7 +47,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got meta.MetaServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -124,10 +124,10 @@ func Test_server_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Val, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -215,10 +215,10 @@ func Test_server_GetMetas(t *testing.T) { } defaultCheckFunc := func(w want, gotMv *payload.Meta_Vals, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMv, w.wantMv) { - return errors.Errorf("got = %v, want %v", gotMv, w.wantMv) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMv, w.wantMv) } return nil } @@ -306,10 +306,10 @@ func Test_server_GetMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Key, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -397,10 +397,10 @@ func Test_server_GetMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, gotMk *payload.Meta_Keys, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMk, w.wantMk) { - return errors.Errorf("got = %v, want %v", gotMk, w.wantMk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMk, w.wantMk) } return nil } @@ -488,10 +488,10 @@ func Test_server_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -579,10 +579,10 @@ func Test_server_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -670,10 +670,10 @@ func Test_server_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Val, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -761,10 +761,10 @@ func Test_server_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, gotMv *payload.Meta_Vals, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMv, w.wantMv) { - return errors.Errorf("got = %v, want %v", gotMv, w.wantMv) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMv, w.wantMv) } return nil } @@ -852,10 +852,10 @@ func Test_server_DeleteMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Key, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -943,10 +943,10 @@ func Test_server_DeleteMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, gotMk *payload.Meta_Keys, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMk, w.wantMk) { - return errors.Errorf("got = %v, want %v", gotMk, w.wantMk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMk, w.wantMk) } return nil } diff --git a/pkg/meta/cassandra/handler/grpc/option_test.go b/pkg/meta/cassandra/handler/grpc/option_test.go index a5b3405d58c..8dde9acf096 100644 --- a/pkg/meta/cassandra/handler/grpc/option_test.go +++ b/pkg/meta/cassandra/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/cassandra/handler/rest/handler_test.go b/pkg/meta/cassandra/handler/rest/handler_test.go index 9ed6532f524..3ed4bd9fa5a 100644 --- a/pkg/meta/cassandra/handler/rest/handler_test.go +++ b/pkg/meta/cassandra/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_GetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_handler_GetMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -486,10 +486,10 @@ func Test_handler_GetMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -577,10 +577,10 @@ func Test_handler_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -668,10 +668,10 @@ func Test_handler_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -759,10 +759,10 @@ func Test_handler_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -850,10 +850,10 @@ func Test_handler_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -941,10 +941,10 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1032,10 +1032,10 @@ func Test_handler_DeleteMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/meta/cassandra/handler/rest/option_test.go b/pkg/meta/cassandra/handler/rest/option_test.go index 05332a9e045..5aa759fe2fc 100644 --- a/pkg/meta/cassandra/handler/rest/option_test.go +++ b/pkg/meta/cassandra/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/cassandra/router/option_test.go b/pkg/meta/cassandra/router/option_test.go index 538c4333420..e128f11bd07 100644 --- a/pkg/meta/cassandra/router/option_test.go +++ b/pkg/meta/cassandra/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/cassandra/router/router_test.go b/pkg/meta/cassandra/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/meta/cassandra/router/router_test.go +++ b/pkg/meta/cassandra/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/meta/cassandra/service/cassandra_test.go b/pkg/meta/cassandra/service/cassandra_test.go index afe0c92dc95..08c66428684 100644 --- a/pkg/meta/cassandra/service/cassandra_test.go +++ b/pkg/meta/cassandra/service/cassandra_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotCas Cassandra, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCas, w.wantCas) { - return errors.Errorf("got = %v, want %v", gotCas, w.wantCas) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCas, w.wantCas) } return nil } @@ -125,7 +125,7 @@ func Test_client_Connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -217,7 +217,7 @@ func Test_client_Close(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -310,10 +310,10 @@ func Test_client_Get(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -406,10 +406,10 @@ func Test_client_GetMultiple(t *testing.T) { } defaultCheckFunc := func(w want, gotVals []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVals, w.wantVals) { - return errors.Errorf("got = %v, want %v", gotVals, w.wantVals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVals, w.wantVals) } return nil } @@ -502,10 +502,10 @@ func Test_client_GetInverse(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -598,10 +598,10 @@ func Test_client_GetInverseMultiple(t *testing.T) { } defaultCheckFunc := func(w want, gotKeys []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotKeys, w.wantKeys) { - return errors.Errorf("got = %v, want %v", gotKeys, w.wantKeys) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotKeys, w.wantKeys) } return nil } @@ -694,7 +694,7 @@ func Test_client_Set(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -788,7 +788,7 @@ func Test_client_SetMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -881,10 +881,10 @@ func Test_client_deleteByKeys(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -977,10 +977,10 @@ func Test_client_Delete(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1073,10 +1073,10 @@ func Test_client_DeleteMultiple(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1169,10 +1169,10 @@ func Test_client_deleteByValues(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1265,10 +1265,10 @@ func Test_client_DeleteInverse(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1361,10 +1361,10 @@ func Test_client_DeleteInverseMultiple(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/meta/cassandra/usecase/meta_test.go b/pkg/meta/cassandra/usecase/meta_test.go index b503e9b8e9e..b9cfa94b08f 100644 --- a/pkg/meta/cassandra/usecase/meta_test.go +++ b/pkg/meta/cassandra/usecase/meta_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/meta/redis/config/config_test.go b/pkg/meta/redis/config/config_test.go index e8090717ead..65a09aba08c 100644 --- a/pkg/meta/redis/config/config_test.go +++ b/pkg/meta/redis/config/config_test.go @@ -43,10 +43,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } diff --git a/pkg/meta/redis/handler/grpc/handler_test.go b/pkg/meta/redis/handler/grpc/handler_test.go index abc38180ae2..d6d5e7df908 100644 --- a/pkg/meta/redis/handler/grpc/handler_test.go +++ b/pkg/meta/redis/handler/grpc/handler_test.go @@ -46,7 +46,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got meta.MetaServer) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -123,10 +123,10 @@ func Test_server_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Val, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -214,10 +214,10 @@ func Test_server_GetMetas(t *testing.T) { } defaultCheckFunc := func(w want, gotMv *payload.Meta_Vals, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMv, w.wantMv) { - return errors.Errorf("got = %v, want %v", gotMv, w.wantMv) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMv, w.wantMv) } return nil } @@ -305,10 +305,10 @@ func Test_server_GetMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Key, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -396,10 +396,10 @@ func Test_server_GetMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, gotMk *payload.Meta_Keys, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMk, w.wantMk) { - return errors.Errorf("got = %v, want %v", gotMk, w.wantMk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMk, w.wantMk) } return nil } @@ -487,10 +487,10 @@ func Test_server_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -578,10 +578,10 @@ func Test_server_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Empty, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -669,10 +669,10 @@ func Test_server_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Val, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -760,10 +760,10 @@ func Test_server_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, gotMv *payload.Meta_Vals, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMv, w.wantMv) { - return errors.Errorf("got = %v, want %v", gotMv, w.wantMv) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMv, w.wantMv) } return nil } @@ -851,10 +851,10 @@ func Test_server_DeleteMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got *payload.Meta_Key, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -942,10 +942,10 @@ func Test_server_DeleteMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, gotMk *payload.Meta_Keys, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotMk, w.wantMk) { - return errors.Errorf("got = %v, want %v", gotMk, w.wantMk) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotMk, w.wantMk) } return nil } diff --git a/pkg/meta/redis/handler/grpc/option_test.go b/pkg/meta/redis/handler/grpc/option_test.go index 39467c23910..fdbfe781fa6 100644 --- a/pkg/meta/redis/handler/grpc/option_test.go +++ b/pkg/meta/redis/handler/grpc/option_test.go @@ -50,10 +50,10 @@ func TestWithRedis(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithRedis(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/redis/handler/rest/handler_test.go b/pkg/meta/redis/handler/rest/handler_test.go index 9ed6532f524..3ed4bd9fa5a 100644 --- a/pkg/meta/redis/handler/rest/handler_test.go +++ b/pkg/meta/redis/handler/rest/handler_test.go @@ -45,7 +45,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -122,10 +122,10 @@ func Test_handler_Index(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,10 +213,10 @@ func Test_handler_GetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -304,10 +304,10 @@ func Test_handler_GetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -395,10 +395,10 @@ func Test_handler_GetMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -486,10 +486,10 @@ func Test_handler_GetMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -577,10 +577,10 @@ func Test_handler_SetMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -668,10 +668,10 @@ func Test_handler_SetMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -759,10 +759,10 @@ func Test_handler_DeleteMeta(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -850,10 +850,10 @@ func Test_handler_DeleteMetas(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -941,10 +941,10 @@ func Test_handler_DeleteMetaInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1032,10 +1032,10 @@ func Test_handler_DeleteMetasInverse(t *testing.T) { } defaultCheckFunc := func(w want, got int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/meta/redis/handler/rest/option_test.go b/pkg/meta/redis/handler/rest/option_test.go index 05332a9e045..5aa759fe2fc 100644 --- a/pkg/meta/redis/handler/rest/option_test.go +++ b/pkg/meta/redis/handler/rest/option_test.go @@ -50,10 +50,10 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/redis/router/option_test.go b/pkg/meta/redis/router/option_test.go index 7af33f2a43c..9b64c0db91f 100644 --- a/pkg/meta/redis/router/option_test.go +++ b/pkg/meta/redis/router/option_test.go @@ -51,10 +51,10 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -164,10 +164,10 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -177,7 +177,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -277,10 +277,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -290,7 +290,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } diff --git a/pkg/meta/redis/router/router_test.go b/pkg/meta/redis/router/router_test.go index 876b9574c48..994118e997a 100644 --- a/pkg/meta/redis/router/router_test.go +++ b/pkg/meta/redis/router/router_test.go @@ -42,7 +42,7 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got http.Handler) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/meta/redis/service/redis_test.go b/pkg/meta/redis/service/redis_test.go index 284a9d18c07..d654fe131f4 100644 --- a/pkg/meta/redis/service/redis_test.go +++ b/pkg/meta/redis/service/redis_test.go @@ -45,10 +45,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, got Redis, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -123,7 +123,7 @@ func Test_client_Disconnect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -217,7 +217,7 @@ func Test_client_Connect(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -319,10 +319,10 @@ func Test_client_Get(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -426,10 +426,10 @@ func Test_client_GetMultiple(t *testing.T) { } defaultCheckFunc := func(w want, gotVals []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVals, w.wantVals) { - return errors.Errorf("got = %v, want %v", gotVals, w.wantVals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVals, w.wantVals) } return nil } @@ -533,10 +533,10 @@ func Test_client_GetInverse(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -640,10 +640,10 @@ func Test_client_GetInverseMultiple(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -746,7 +746,7 @@ func Test_client_appendPrefix(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -851,10 +851,10 @@ func Test_client_get(t *testing.T) { } defaultCheckFunc := func(w want, gotVal string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVal, w.wantVal) { - return errors.Errorf("got = %v, want %v", gotVal, w.wantVal) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVal, w.wantVal) } return nil } @@ -961,10 +961,10 @@ func Test_client_getMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotVals []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVals, w.wantVals) { - return errors.Errorf("got = %v, want %v", gotVals, w.wantVals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVals, w.wantVals) } return nil } @@ -1070,7 +1070,7 @@ func Test_client_Set(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1175,7 +1175,7 @@ func Test_client_SetMultiple(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -1279,10 +1279,10 @@ func Test_client_Delete(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1386,10 +1386,10 @@ func Test_client_DeleteMultiple(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1493,10 +1493,10 @@ func Test_client_DeleteInverse(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1600,10 +1600,10 @@ func Test_client_DeleteInverseMultiple(t *testing.T) { } defaultCheckFunc := func(w want, got []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1709,10 +1709,10 @@ func Test_client_delete(t *testing.T) { } defaultCheckFunc := func(w want, gotVal string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVal, w.wantVal) { - return errors.Errorf("got = %v, want %v", gotVal, w.wantVal) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVal, w.wantVal) } return nil } @@ -1822,10 +1822,10 @@ func Test_client_deleteMulti(t *testing.T) { } defaultCheckFunc := func(w want, gotVals []string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotVals, w.wantVals) { - return errors.Errorf("got = %v, want %v", gotVals, w.wantVals) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVals, w.wantVals) } return nil } diff --git a/pkg/meta/redis/usecase/meta_test.go b/pkg/meta/redis/usecase/meta_test.go index 9852250655d..0adca704ab9 100644 --- a/pkg/meta/redis/usecase/meta_test.go +++ b/pkg/meta/redis/usecase/meta_test.go @@ -50,10 +50,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -132,7 +132,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -233,10 +233,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -436,7 +436,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -536,7 +536,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/tools/cli/loadtest/assets/dataset_test.go b/pkg/tools/cli/loadtest/assets/dataset_test.go index 5bc0e38bf2e..c99e444e067 100644 --- a/pkg/tools/cli/loadtest/assets/dataset_test.go +++ b/pkg/tools/cli/loadtest/assets/dataset_test.go @@ -41,7 +41,7 @@ func Test_identity(t *testing.T) { } defaultCheckFunc := func(w want, got func() (Dataset, error)) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -113,7 +113,7 @@ func Test_random(t *testing.T) { } defaultCheckFunc := func(w want, got func() (Dataset, error)) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -183,10 +183,10 @@ func Test_datasetDir(t *testing.T) { } defaultCheckFunc := func(w want, got string, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -251,7 +251,7 @@ func TestData(t *testing.T) { } defaultCheckFunc := func(w want, got func() (Dataset, error)) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -336,7 +336,7 @@ func Test_dataset_Train(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -466,7 +466,7 @@ func Test_dataset_TrainAsFloat64(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -596,7 +596,7 @@ func Test_dataset_Query(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -726,7 +726,7 @@ func Test_dataset_QueryAsFloat64(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -856,7 +856,7 @@ func Test_dataset_Distances(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float32) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -986,7 +986,7 @@ func Test_dataset_DistancesAsFloat64(t *testing.T) { } defaultCheckFunc := func(w want, got [][]float64) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1116,7 +1116,7 @@ func Test_dataset_Neighbors(t *testing.T) { } defaultCheckFunc := func(w want, got [][]int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1246,7 +1246,7 @@ func Test_dataset_IDs(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1376,7 +1376,7 @@ func Test_dataset_Name(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1506,7 +1506,7 @@ func Test_dataset_Dimension(t *testing.T) { } defaultCheckFunc := func(w want, got int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1636,7 +1636,7 @@ func Test_dataset_DistanceType(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1766,7 +1766,7 @@ func Test_dataset_ObjectType(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -1882,7 +1882,7 @@ func Test_float32To64(t *testing.T) { } defaultCheckFunc := func(w want, gotY [][]float64) error { if !reflect.DeepEqual(gotY, w.wantY) { - return errors.Errorf("got = %v, want %v", gotY, w.wantY) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotY, w.wantY) } return nil } diff --git a/pkg/tools/cli/loadtest/assets/loader_test.go b/pkg/tools/cli/loadtest/assets/loader_test.go index 4333e217609..b7065dc0129 100644 --- a/pkg/tools/cli/loadtest/assets/loader_test.go +++ b/pkg/tools/cli/loadtest/assets/loader_test.go @@ -45,10 +45,10 @@ func Test_loadFloat32(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -129,10 +129,10 @@ func Test_loadInt(t *testing.T) { } defaultCheckFunc := func(w want, got interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -213,13 +213,13 @@ func Test_loadDataset(t *testing.T) { } defaultCheckFunc := func(w want, gotDim int, gotVec interface{}, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotDim, w.wantDim) { - return errors.Errorf("got = %v, want %v", gotDim, w.wantDim) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDim, w.wantDim) } if !reflect.DeepEqual(gotVec, w.wantVec) { - return errors.Errorf("got = %v, want %v", gotVec, w.wantVec) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotVec, w.wantVec) } return nil } @@ -299,22 +299,22 @@ func TestLoad(t *testing.T) { } defaultCheckFunc := func(w want, gotTrain [][]float32, gotTest [][]float32, gotDistances [][]float32, gotNeighbors [][]int, gotDim int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotTrain, w.wantTrain) { - return errors.Errorf("got = %v, want %v", gotTrain, w.wantTrain) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotTrain, w.wantTrain) } if !reflect.DeepEqual(gotTest, w.wantTest) { - return errors.Errorf("got = %v, want %v", gotTest, w.wantTest) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotTest, w.wantTest) } if !reflect.DeepEqual(gotDistances, w.wantDistances) { - return errors.Errorf("got = %v, want %v", gotDistances, w.wantDistances) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDistances, w.wantDistances) } if !reflect.DeepEqual(gotNeighbors, w.wantNeighbors) { - return errors.Errorf("got = %v, want %v", gotNeighbors, w.wantNeighbors) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotNeighbors, w.wantNeighbors) } if !reflect.DeepEqual(gotDim, w.wantDim) { - return errors.Errorf("got = %v, want %v", gotDim, w.wantDim) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotDim, w.wantDim) } return nil } @@ -385,7 +385,7 @@ func TestCreateRandomIDs(t *testing.T) { } defaultCheckFunc := func(w want, gotIds []string) error { if !reflect.DeepEqual(gotIds, w.wantIds) { - return errors.Errorf("got = %v, want %v", gotIds, w.wantIds) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIds, w.wantIds) } return nil } @@ -457,7 +457,7 @@ func TestCreateRandomIDsWithLength(t *testing.T) { } defaultCheckFunc := func(w want, gotIds []string) error { if !reflect.DeepEqual(gotIds, w.wantIds) { - return errors.Errorf("got = %v, want %v", gotIds, w.wantIds) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotIds, w.wantIds) } return nil } @@ -530,7 +530,7 @@ func TestCreateSerialIDs(t *testing.T) { } defaultCheckFunc := func(w want, got []string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -602,10 +602,10 @@ func TestLoadDataWithRandomIDs(t *testing.T) { } defaultCheckFunc := func(w want, got Dataset, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -677,10 +677,10 @@ func TestLoadDataWithSerialIDs(t *testing.T) { } defaultCheckFunc := func(w want, got Dataset, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/tools/cli/loadtest/config/config_test.go b/pkg/tools/cli/loadtest/config/config_test.go index eeb98b9a3df..b3f6741c433 100644 --- a/pkg/tools/cli/loadtest/config/config_test.go +++ b/pkg/tools/cli/loadtest/config/config_test.go @@ -42,7 +42,7 @@ func TestOperationMethod(t *testing.T) { } defaultCheckFunc := func(w want, got Operation) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -110,7 +110,7 @@ func TestOperation_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -176,10 +176,10 @@ func TestNewConfig(t *testing.T) { } defaultCheckFunc := func(w want, gotCfg *Data, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotCfg, w.wantCfg) { - return errors.Errorf("got = %v, want %v", gotCfg, w.wantCfg) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotCfg, w.wantCfg) } return nil } @@ -250,7 +250,7 @@ func TestServiceMethod(t *testing.T) { } defaultCheckFunc := func(w want, got Service) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -318,7 +318,7 @@ func TestService_String(t *testing.T) { } defaultCheckFunc := func(w want, got string) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/tools/cli/loadtest/service/insert_test.go b/pkg/tools/cli/loadtest/service/insert_test.go index afe9fc55929..85750f050df 100644 --- a/pkg/tools/cli/loadtest/service/insert_test.go +++ b/pkg/tools/cli/loadtest/service/insert_test.go @@ -50,13 +50,13 @@ func Test_insertRequestProvider(t *testing.T) { } defaultCheckFunc := func(w want, gotF func() interface{}, gotSize int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotF, w.wantF) { - return errors.Errorf("got = %v, want %v", gotF, w.wantF) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotF, w.wantF) } if !reflect.DeepEqual(gotSize, w.wantSize) { - return errors.Errorf("got = %v, want %v", gotSize, w.wantSize) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotSize, w.wantSize) } return nil } @@ -130,10 +130,10 @@ func Test_objectVectorProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() interface{}, got1 int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -206,10 +206,10 @@ func Test_objectVectorsProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() interface{}, got1 int) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -282,7 +282,7 @@ func Test_agent(t *testing.T) { } defaultCheckFunc := func(w want, got inserter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -353,7 +353,7 @@ func Test_gateway(t *testing.T) { } defaultCheckFunc := func(w want, got inserter) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -424,7 +424,7 @@ func Test_insert(t *testing.T) { } defaultCheckFunc := func(w want, got loadFunc) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -495,7 +495,7 @@ func Test_bulkInsert(t *testing.T) { } defaultCheckFunc := func(w want, got loadFunc) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -578,10 +578,10 @@ func Test_loader_newInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotF loadFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotF, w.wantF) { - return errors.Errorf("got = %v, want %v", gotF, w.wantF) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotF, w.wantF) } return nil } @@ -700,10 +700,10 @@ func Test_loader_newStreamInsert(t *testing.T) { } defaultCheckFunc := func(w want, gotF loadFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotF, w.wantF) { - return errors.Errorf("got = %v, want %v", gotF, w.wantF) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotF, w.wantF) } return nil } diff --git a/pkg/tools/cli/loadtest/service/loader_option_test.go b/pkg/tools/cli/loadtest/service/loader_option_test.go index 16379ed168d..fd88d46f732 100644 --- a/pkg/tools/cli/loadtest/service/loader_option_test.go +++ b/pkg/tools/cli/loadtest/service/loader_option_test.go @@ -50,10 +50,10 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -163,10 +163,10 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -176,7 +176,7 @@ func TestWithClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -276,10 +276,10 @@ func TestWithConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -289,7 +289,7 @@ func TestWithConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -389,10 +389,10 @@ func TestWithDataset(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -402,7 +402,7 @@ func TestWithDataset(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -502,10 +502,10 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -515,7 +515,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -615,10 +615,10 @@ func TestWithProgressDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -628,7 +628,7 @@ func TestWithProgressDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -728,10 +728,10 @@ func TestWithOperation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.obj) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.obj) } return nil } @@ -741,7 +741,7 @@ func TestWithOperation(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return errors.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", obj, w.c) } return nil } @@ -833,7 +833,7 @@ func TestWithBatchSize(t *testing.T) { } defaultCheckFunc := func(w want, got Option) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -904,7 +904,7 @@ func TestWithService(t *testing.T) { } defaultCheckFunc := func(w want, got Option) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/tools/cli/loadtest/service/loader_test.go b/pkg/tools/cli/loadtest/service/loader_test.go index 8f543bbc76f..4df6fac2325 100644 --- a/pkg/tools/cli/loadtest/service/loader_test.go +++ b/pkg/tools/cli/loadtest/service/loader_test.go @@ -46,10 +46,10 @@ func TestNewLoader(t *testing.T) { } defaultCheckFunc := func(w want, got Loader, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -135,7 +135,7 @@ func Test_loader_Prepare(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -263,7 +263,7 @@ func Test_loader_Do(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error) error { if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -393,7 +393,7 @@ func Test_loader_do(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } diff --git a/pkg/tools/cli/loadtest/service/search_test.go b/pkg/tools/cli/loadtest/service/search_test.go index 8452381a995..68fe29f144b 100644 --- a/pkg/tools/cli/loadtest/service/search_test.go +++ b/pkg/tools/cli/loadtest/service/search_test.go @@ -47,13 +47,13 @@ func Test_searchRequestProvider(t *testing.T) { } defaultCheckFunc := func(w want, got func() interface{}, got1 int, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } if !reflect.DeepEqual(got1, w.want1) { - return errors.Errorf("got = %v, want %v", got1, w.want1) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got1, w.want1) } return nil } @@ -136,10 +136,10 @@ func Test_loader_newSearch(t *testing.T) { } defaultCheckFunc := func(w want, got loadFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -258,10 +258,10 @@ func Test_loader_newStreamSearch(t *testing.T) { } defaultCheckFunc := func(w want, got loadFunc, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } diff --git a/pkg/tools/cli/loadtest/usecase/load_test.go b/pkg/tools/cli/loadtest/usecase/load_test.go index c2f5768d7c9..3e51ff173bd 100644 --- a/pkg/tools/cli/loadtest/usecase/load_test.go +++ b/pkg/tools/cli/loadtest/usecase/load_test.go @@ -48,10 +48,10 @@ func TestNew(t *testing.T) { } defaultCheckFunc := func(w want, gotR runner.Runner, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(gotR, w.wantR) { - return errors.Errorf("got = %v, want %v", gotR, w.wantR) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", gotR, w.wantR) } return nil } @@ -128,7 +128,7 @@ func Test_run_PreStart(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -221,10 +221,10 @@ func Test_run_Start(t *testing.T) { } defaultCheckFunc := func(w want, got <-chan error, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got = %v, want %v", got, w.want) + return errors.Errorf("got: \"%v\",\twant: \"%v\"", got, w.want) } return nil } @@ -316,7 +316,7 @@ func Test_run_PreStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -408,7 +408,7 @@ func Test_run_Stop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil } @@ -500,7 +500,7 @@ func Test_run_PostStop(t *testing.T) { } defaultCheckFunc := func(w want, err error) error { if !errors.Is(err, w.err) { - return errors.Errorf("got error = %v, want %v", err, w.err) + return errors.Errorf("got_error: \"%v\",\twant: \"%v\"", err, w.err) } return nil }