diff --git a/assets/test/templates/option/function.tmpl b/assets/test/templates/option/function.tmpl index c424690d60..116b5cb28d 100644 --- a/assets/test/templates/option/function.tmpl +++ b/assets/test/templates/option/function.tmpl @@ -64,7 +64,7 @@ func {{ .TestName }}(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/go.mod b/go.mod index ac3b3f0a47..70668c825d 100755 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( go.uber.org/automaxprocs v1.3.0 go.uber.org/goleak v1.0.0 golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 - golang.org/x/tools v0.0.0-20200501005904-d351ea090f9b // indirect + golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d // indirect gonum.org/v1/hdf5 v0.0.0-20191105085658-fe04b73f3b53 gonum.org/v1/netlib v0.0.0-20200317120129-c5a04cffd98a // indirect gonum.org/v1/plot v0.7.0 diff --git a/go.sum b/go.sum index 526f81b8c9..f81173c4ca 100644 --- a/go.sum +++ b/go.sum @@ -598,6 +598,8 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200501005904-d351ea090f9b h1:2hSR2MyOaYEy6yJYg/CpErymr/m7xJEJpm9kfT7ZMg4= golang.org/x/tools v0.0.0-20200501005904-d351ea090f9b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d h1:lzLdP95xJmMpwQ6LUHwrc5V7js93hTiY7gkznu0BgmY= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/hack/benchmark/core/benchmark/option_test.go b/hack/benchmark/core/benchmark/option_test.go index 815334eac2..daea019a90 100644 --- a/hack/benchmark/core/benchmark/option_test.go +++ b/hack/benchmark/core/benchmark/option_test.go @@ -61,7 +61,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 868fb3d008..16e3e80f7b 100644 --- a/hack/benchmark/core/benchmark/strategy/strategy_option_test.go +++ b/hack/benchmark/core/benchmark/strategy/strategy_option_test.go @@ -65,7 +65,7 @@ func TestWithPreProp32(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/assets/loader.go b/hack/benchmark/internal/assets/loader.go index 437e4fdce9..b05184dc8a 100644 --- a/hack/benchmark/internal/assets/loader.go +++ b/hack/benchmark/internal/assets/loader.go @@ -16,10 +16,10 @@ package assets import ( - "fmt" "strconv" "github.com/kpango/fuid" + "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "gonum.org/v1/hdf5" ) @@ -103,7 +103,7 @@ func Load(path string) (train, test, distances [][]float32, neighbors [][]int, d } test = v2.([][]float32) if dim != testDim { - return train, test, nil, nil, 0, fmt.Errorf("test has different dimension from train") + return train, test, nil, nil, 0, errors.Errorf("test has different dimension from train") } distancesDim, v3, err := loadDataset(f, "distances", loadFloat32) if err != nil { @@ -119,7 +119,7 @@ func Load(path string) (train, test, distances [][]float32, neighbors [][]int, d } neighbors = v4.([][]int) if distancesDim != neighborsDim { - return train, test, distances, neighbors, dim, fmt.Errorf("neighbors has different dimension from distances") + return train, test, distances, neighbors, dim, errors.Errorf("neighbors has different dimension from distances") } return train, test, distances, neighbors, dim, nil diff --git a/hack/benchmark/internal/client/ngtd/grpc/option_test.go b/hack/benchmark/internal/client/ngtd/grpc/option_test.go index f5ae4a334e..fc93f12908 100644 --- a/hack/benchmark/internal/client/ngtd/grpc/option_test.go +++ b/hack/benchmark/internal/client/ngtd/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 012ab58e7a..3f6d7e91e3 100644 --- a/hack/benchmark/internal/client/ngtd/rest/option_test.go +++ b/hack/benchmark/internal/client/ngtd/rest/option_test.go @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/core/gongt/option_test.go b/hack/benchmark/internal/core/gongt/option_test.go index 375c3ef6eb..a2eb14ab01 100644 --- a/hack/benchmark/internal/core/gongt/option_test.go +++ b/hack/benchmark/internal/core/gongt/option_test.go @@ -61,7 +61,7 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/core/ngt/option_test.go b/hack/benchmark/internal/core/ngt/option_test.go index d1c982595c..370c8bc2f4 100644 --- a/hack/benchmark/internal/core/ngt/option_test.go +++ b/hack/benchmark/internal/core/ngt/option_test.go @@ -61,7 +61,7 @@ func TestWithIndexPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/e2e/option_test.go b/hack/benchmark/internal/e2e/option_test.go index d473ca1aaf..c67f8c79c6 100644 --- a/hack/benchmark/internal/e2e/option_test.go +++ b/hack/benchmark/internal/e2e/option_test.go @@ -65,7 +65,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 560216aa55..9cd77161ba 100644 --- a/hack/benchmark/internal/e2e/strategy/create_index_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/create_index_option_test.go @@ -63,7 +63,7 @@ func TestWithCreateIndexPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 216214bd65..a046f99211 100644 --- a/hack/benchmark/internal/e2e/strategy/insert_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/insert_option_test.go @@ -61,7 +61,7 @@ func TestWithParallelInsert(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 42bf51c72d..95f8d626db 100644 --- a/hack/benchmark/internal/e2e/strategy/remove_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/remove_option_test.go @@ -61,7 +61,7 @@ func TestWithParallelRemove(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 7e1809e305..2ed0aa5fb6 100644 --- a/hack/benchmark/internal/e2e/strategy/search_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/search_option_test.go @@ -63,7 +63,7 @@ func TestWithSearchParallel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 427fe6ca2d..1e00c7e834 100644 --- a/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go +++ b/hack/benchmark/internal/e2e/strategy/stream_search_option_test.go @@ -63,7 +63,7 @@ func TestWithStreamSearchConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/hack/benchmark/internal/starter/agent/ngt/option_test.go b/hack/benchmark/internal/starter/agent/ngt/option_test.go index 9a38bdbcad..415724a9ca 100644 --- a/hack/benchmark/internal/starter/agent/ngt/option_test.go +++ b/hack/benchmark/internal/starter/agent/ngt/option_test.go @@ -63,7 +63,7 @@ func TestWithConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 e0fc5e9d10..8b90cda1e7 100644 --- a/hack/benchmark/internal/starter/external/ngtd/option_test.go +++ b/hack/benchmark/internal/starter/external/ngtd/option_test.go @@ -61,7 +61,7 @@ func TestWithDimentaion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/backoff/option_test.go b/internal/backoff/option_test.go index 9e624e97bc..6dc4544e26 100644 --- a/internal/backoff/option_test.go +++ b/internal/backoff/option_test.go @@ -454,7 +454,7 @@ func TestWithEnableErrorLog(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/cache/gache/option_test.go b/internal/cache/gache/option_test.go index 1f4d6438b8..1ca0450c54 100644 --- a/internal/cache/gache/option_test.go +++ b/internal/cache/gache/option_test.go @@ -65,7 +65,7 @@ func TestWithGache(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -178,7 +178,7 @@ func TestWithExpiredHook(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -291,7 +291,7 @@ func TestWithExpireDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -404,7 +404,7 @@ func TestWithExpireCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/cache/option_test.go b/internal/cache/option_test.go index 3aced282ab..073295b4f3 100644 --- a/internal/cache/option_test.go +++ b/internal/cache/option_test.go @@ -62,7 +62,7 @@ func TestWithExpiredHook(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -175,7 +175,7 @@ func TestWithType(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -288,7 +288,7 @@ func TestWithExpireDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -401,7 +401,7 @@ func TestWithExpireCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/agent/ngt/grpc/option_test.go b/internal/client/agent/ngt/grpc/option_test.go index fe98d463e9..cd04e68fbe 100644 --- a/internal/client/agent/ngt/grpc/option_test.go +++ b/internal/client/agent/ngt/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/agent/ngt/rest/option_test.go b/internal/client/agent/ngt/rest/option_test.go index fce759c5fb..1390f7e458 100644 --- a/internal/client/agent/ngt/rest/option_test.go +++ b/internal/client/agent/ngt/rest/option_test.go @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/compressor/option_test.go b/internal/client/compressor/option_test.go index 1f9b16e64a..d0e75d4815 100644 --- a/internal/client/compressor/option_test.go +++ b/internal/client/compressor/option_test.go @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/discoverer/option_test.go b/internal/client/discoverer/option_test.go index 774ba2f9d9..716f550c02 100644 --- a/internal/client/discoverer/option_test.go +++ b/internal/client/discoverer/option_test.go @@ -65,7 +65,7 @@ func TestWithOnDiscoverFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/gateway/vald/grpc/option_test.go b/internal/client/gateway/vald/grpc/option_test.go index 73c829d46e..f59f130c0d 100644 --- a/internal/client/gateway/vald/grpc/option_test.go +++ b/internal/client/gateway/vald/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/client/gateway/vald/rest/option_test.go b/internal/client/gateway/vald/rest/option_test.go index 3ce17243d2..a88fe9defa 100644 --- a/internal/client/gateway/vald/rest/option_test.go +++ b/internal/client/gateway/vald/rest/option_test.go @@ -61,7 +61,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/compress/gzip_option_test.go b/internal/compress/gzip_option_test.go index 60d9e15c30..4c6a22d7f4 100644 --- a/internal/compress/gzip_option_test.go +++ b/internal/compress/gzip_option_test.go @@ -61,7 +61,7 @@ func TestWithGzipGob(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithGzipCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/compress/lz4_option_test.go b/internal/compress/lz4_option_test.go index 6d6f10334c..1225835de1 100644 --- a/internal/compress/lz4_option_test.go +++ b/internal/compress/lz4_option_test.go @@ -61,7 +61,7 @@ func TestWithLZ4Gob(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithLZ4CompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/compress/zstd_option_test.go b/internal/compress/zstd_option_test.go index 87c7f4aea9..1af3685d76 100644 --- a/internal/compress/zstd_option_test.go +++ b/internal/compress/zstd_option_test.go @@ -61,7 +61,7 @@ func TestWithZstdGob(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithZstdCompressionLevel(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/core/converter/tensorflow/option_test.go b/internal/core/converter/tensorflow/option_test.go index 580e3176d3..3da2be475e 100644 --- a/internal/core/converter/tensorflow/option_test.go +++ b/internal/core/converter/tensorflow/option_test.go @@ -61,7 +61,7 @@ func TestWithSessionOptions(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithSessionTarget(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -287,7 +287,7 @@ func TestWithSessionConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -400,7 +400,7 @@ func TestWithOperations(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -513,7 +513,7 @@ func TestWithExportPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -626,7 +626,7 @@ func TestWithTags(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -740,7 +740,7 @@ func TestWithFeed(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -856,7 +856,7 @@ func TestWithFeeds(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -972,7 +972,7 @@ func TestWithFetch(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1088,7 +1088,7 @@ func TestWithFetches(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1203,7 +1203,7 @@ func TestWithNdim(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/db/kvs/redis/option_test.go b/internal/db/kvs/redis/option_test.go index ba9e5284aa..fd48aa04d5 100644 --- a/internal/db/kvs/redis/option_test.go +++ b/internal/db/kvs/redis/option_test.go @@ -66,7 +66,7 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -179,7 +179,7 @@ func TestWithAddrs(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -292,7 +292,7 @@ func TestWithDB(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -405,7 +405,7 @@ func TestWithClusterSlots(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -518,7 +518,7 @@ func TestWithDialTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -631,7 +631,7 @@ func TestWithIdleCheckFrequency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -744,7 +744,7 @@ func TestWithIdleTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -857,7 +857,7 @@ func TestWithKeyPrefix(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -970,7 +970,7 @@ func TestWithMaximumConnectionAge(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1083,7 +1083,7 @@ func TestWithRedirectLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1196,7 +1196,7 @@ func TestWithRetryLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1309,7 +1309,7 @@ func TestWithMaximumRetryBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1422,7 +1422,7 @@ func TestWithMinimumIdleConnection(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1535,7 +1535,7 @@ func TestWithMinimumRetryBackoff(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1648,7 +1648,7 @@ func TestWithOnConnectFunction(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1761,7 +1761,7 @@ func TestWithOnNewNodeFunction(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1874,7 +1874,7 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1987,7 +1987,7 @@ func TestWithPoolSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2100,7 +2100,7 @@ func TestWithPoolTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2213,7 +2213,7 @@ func TestWithReadOnlyFlag(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2326,7 +2326,7 @@ func TestWithReadTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2439,7 +2439,7 @@ func TestWithRouteByLatencyFlag(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2552,7 +2552,7 @@ func TestWithRouteRandomlyFlag(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2665,7 +2665,7 @@ func TestWithTLSConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2778,7 +2778,7 @@ func TestWithWriteTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2891,7 +2891,7 @@ func TestWithInitialPingTimeLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3004,7 +3004,7 @@ func TestWithInitialPingDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/db/nosql/cassandra/option_test.go b/internal/db/nosql/cassandra/option_test.go index 79f435b943..14e3628481 100644 --- a/internal/db/nosql/cassandra/option_test.go +++ b/internal/db/nosql/cassandra/option_test.go @@ -65,7 +65,7 @@ func TestWithHosts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -178,7 +178,7 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -291,7 +291,7 @@ func TestWithCQLVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -404,7 +404,7 @@ func TestWithProtoVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -517,7 +517,7 @@ func TestWithTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -630,7 +630,7 @@ func TestWithConnectTimeout(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -743,7 +743,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -856,7 +856,7 @@ func TestWithKeyspace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -969,7 +969,7 @@ func TestWithNumConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1082,7 +1082,7 @@ func TestWithConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1195,7 +1195,7 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1308,7 +1308,7 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1421,7 +1421,7 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1534,7 +1534,7 @@ func TestWithAuthProvider(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1647,7 +1647,7 @@ func TestWithRetryPolicyNumRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1760,7 +1760,7 @@ func TestWithRetryPolicyMinDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1873,7 +1873,7 @@ func TestWithRetryPolicyMaxDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1986,7 +1986,7 @@ func TestWithReconnectionPolicyInitialInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2099,7 +2099,7 @@ func TestWithReconnectionPolicyMaxRetries(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2212,7 +2212,7 @@ func TestWithSocketKeepalive(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2325,7 +2325,7 @@ func TestWithMaxPreparedStmts(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2438,7 +2438,7 @@ func TestWithMaxRoutingKeyInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2551,7 +2551,7 @@ func TestWithPageSize(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2664,7 +2664,7 @@ func TestWithSerialConsistency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2777,7 +2777,7 @@ func TestWithTLS(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -2890,7 +2890,7 @@ func TestWithTLSCertPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3003,7 +3003,7 @@ func TestWithTLSKeyPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3116,7 +3116,7 @@ func TestWithTLSCAPath(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3229,7 +3229,7 @@ func TestWithEnableHostVerification(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3342,7 +3342,7 @@ func TestWithDefaultTimestamp(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3455,7 +3455,7 @@ func TestWithDC(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3568,7 +3568,7 @@ func TestWithDCAwareRouting(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3681,7 +3681,7 @@ func TestWithNonLocalReplicasFallback(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3794,7 +3794,7 @@ func TestWithShuffleReplicas(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -3907,7 +3907,7 @@ func TestWithMaxWaitSchemaAgreement(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4020,7 +4020,7 @@ func TestWithReconnectInterval(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4133,7 +4133,7 @@ func TestWithIgnorePeerAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4246,7 +4246,7 @@ func TestWithDisableInitialHostLookup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4359,7 +4359,7 @@ func TestWithDisableNodeStatusEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4472,7 +4472,7 @@ func TestWithDisableTopologyEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4585,7 +4585,7 @@ func TestWithDisableSchemaEvents(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4698,7 +4698,7 @@ func TestWithDisableSkipMetadata(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4811,7 +4811,7 @@ func TestWithDefaultIdempotence(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -4924,7 +4924,7 @@ func TestWithWriteCoalesceWaitTime(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -5037,7 +5037,7 @@ func TestWithTokenAwareHostPolicy(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -5150,7 +5150,7 @@ func TestWithHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -5263,7 +5263,7 @@ func TestWithDCHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -5376,7 +5376,7 @@ func TestWithWhiteListHostFilter(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/db/rdb/mysql/option_test.go b/internal/db/rdb/mysql/option_test.go index 3a2092f909..111b5680eb 100644 --- a/internal/db/rdb/mysql/option_test.go +++ b/internal/db/rdb/mysql/option_test.go @@ -64,7 +64,7 @@ func TestWithTimezone(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -177,7 +177,7 @@ func TestWithCharset(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -290,7 +290,7 @@ func TestWithDB(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -403,7 +403,7 @@ func TestWithHost(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -516,7 +516,7 @@ func TestWithPort(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -629,7 +629,7 @@ func TestWithUser(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -742,7 +742,7 @@ func TestWithPass(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -855,7 +855,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -968,7 +968,7 @@ func TestWithInitialPingTimeLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1081,7 +1081,7 @@ func TestWithInitialPingDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1194,7 +1194,7 @@ func TestWithConnectionLifeTimeLimit(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1307,7 +1307,7 @@ func TestWithMaxIdleConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1420,7 +1420,7 @@ func TestWithMaxOpenConns(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1533,7 +1533,7 @@ func TestWithTLSConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -1646,7 +1646,7 @@ func TestWithDialer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/k8s/metrics/node/option_test.go b/internal/k8s/metrics/node/option_test.go index fd1c6d97ec..b9a69a991c 100644 --- a/internal/k8s/metrics/node/option_test.go +++ b/internal/k8s/metrics/node/option_test.go @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 c4bc9dc201..39d3f42835 100644 --- a/internal/k8s/metrics/pod/option_test.go +++ b/internal/k8s/metrics/pod/option_test.go @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/k8s/node/option_test.go b/internal/k8s/node/option_test.go index 9919501d7c..76f176c515 100644 --- a/internal/k8s/node/option_test.go +++ b/internal/k8s/node/option_test.go @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/k8s/option_test.go b/internal/k8s/option_test.go index 238fb73a9a..9bc145ec91 100644 --- a/internal/k8s/option_test.go +++ b/internal/k8s/option_test.go @@ -64,7 +64,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/k8s/pod/option_test.go b/internal/k8s/pod/option_test.go index aa679968f2..525019b375 100644 --- a/internal/k8s/pod/option_test.go +++ b/internal/k8s/pod/option_test.go @@ -63,7 +63,7 @@ func TestWithControllerName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/net/grpc/option_test.go b/internal/net/grpc/option_test.go index 857dc2a469..e6389766ed 100644 --- a/internal/net/grpc/option_test.go +++ b/internal/net/grpc/option_test.go @@ -67,7 +67,7 @@ func TestWithAddrs(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 42f76a7d71..359567afc7 100644 --- a/internal/net/grpc/pool/option_test.go +++ b/internal/net/grpc/pool/option_test.go @@ -63,7 +63,7 @@ func TestWithAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/net/http/middleware/option_test.go b/internal/net/http/middleware/option_test.go index 0fe508683d..aaef604df5 100644 --- a/internal/net/http/middleware/option_test.go +++ b/internal/net/http/middleware/option_test.go @@ -16,12 +16,12 @@ package middleware import ( - "fmt" "reflect" "testing" "time" "github.com/vdaas/vald/internal/errgroup" + "github.com/vdaas/vald/internal/errors" ) func TestWithErrorGroup(t *testing.T) { @@ -40,7 +40,7 @@ func TestWithErrorGroup(t *testing.T) { opt(got) if got.dur != 10*time.Second { - return fmt.Errorf("invalid param was set") + return errors.Errorf("invalid param was set") } return nil }, @@ -53,7 +53,7 @@ func TestWithErrorGroup(t *testing.T) { opt(got) if got.dur != 3*time.Second { - return fmt.Errorf("invalid param was set") + return errors.Errorf("invalid param was set") } return nil }, @@ -89,7 +89,7 @@ func TestWithTimeout(t *testing.T) { opt(got) if !reflect.DeepEqual(got.eg, eg) { - return fmt.Errorf("invalid param was set") + return errors.Errorf("invalid param was set") } return nil }, diff --git a/internal/net/http/middleware/timeout_test.go b/internal/net/http/middleware/timeout_test.go index 84db985b2f..60547ea9d2 100644 --- a/internal/net/http/middleware/timeout_test.go +++ b/internal/net/http/middleware/timeout_test.go @@ -16,7 +16,6 @@ package middleware import ( - "fmt" "net/http" "net/http/httptest" "reflect" @@ -97,15 +96,15 @@ func TestWrap(t *testing.T) { }, checkFunc: func(code int, err error) error { if err != nil { - return fmt.Errorf("err is not nil. err: %v", err) + return errors.Errorf("err is not nil. err: %v", err) } if code != http.StatusOK { - return fmt.Errorf("code is not equals. want: %v, got: %v", http.StatusOK, code) + return errors.Errorf("code is not equals. want: %v, got: %v", http.StatusOK, code) } if cnt != 1 { - return fmt.Errorf("called cnt is equals. want: %v, got: %v", 1, cnt) + return errors.Errorf("called cnt is equals. want: %v, got: %v", 1, cnt) } return nil @@ -113,7 +112,7 @@ func TestWrap(t *testing.T) { } }(), func() test { - wantErr := fmt.Errorf("faild") + wantErr := errors.Errorf("faild") var cnt int h := func(w http.ResponseWriter, req *http.Request) (code int, err error) { @@ -134,15 +133,15 @@ func TestWrap(t *testing.T) { }, checkFunc: func(code int, err error) error { if !errors.Is(err, wantErr) { - return fmt.Errorf("err not equals. want: %v, got: %v", wantErr, err) + return errors.Errorf("err not equals. want: %v, got: %v", wantErr, err) } if code != http.StatusInternalServerError { - return fmt.Errorf("code is not equals. want: %v, got: %v", http.StatusInternalServerError, code) + return errors.Errorf("code is not equals. want: %v, got: %v", http.StatusInternalServerError, code) } if cnt != 1 { - return fmt.Errorf("called cnt is equals. want: %v, got: %v", 1, cnt) + return errors.Errorf("called cnt is equals. want: %v, got: %v", 1, cnt) } return nil @@ -168,15 +167,15 @@ func TestWrap(t *testing.T) { }, checkFunc: func(code int, err error) error { if err == nil { - return fmt.Errorf("err is nil") + return errors.Errorf("err is nil") } if code != http.StatusRequestTimeout { - return fmt.Errorf("code is not equals. want: %v, got: %v", http.StatusRequestTimeout, code) + return errors.Errorf("code is not equals. want: %v, got: %v", http.StatusRequestTimeout, code) } if !strings.Contains(err.Error(), "handler timeout") { - return fmt.Errorf("err string no contains word of `handler timeout`") + return errors.Errorf("err string no contains word of `handler timeout`") } return nil diff --git a/internal/net/http/transport/roundtrip_test.go b/internal/net/http/transport/roundtrip_test.go index 3b07b8283d..d0d9e925ef 100644 --- a/internal/net/http/transport/roundtrip_test.go +++ b/internal/net/http/transport/roundtrip_test.go @@ -18,7 +18,6 @@ package transport import ( "bytes" "context" - "fmt" "io/ioutil" "net/http" "reflect" @@ -89,7 +88,7 @@ func TestRoundTrip(t *testing.T) { }, checkFunc: func(res *http.Response, err error) error { if err != nil { - return fmt.Errorf("error not nil. err: %v", err) + return errors.Errorf("error not nil. err: %v", err) } if !reflect.DeepEqual(res, wantRes) { diff --git a/internal/observability/collector/collector_option_test.go b/internal/observability/collector/collector_option_test.go index 8359cc7d15..5adcd9658c 100644 --- a/internal/observability/collector/collector_option_test.go +++ b/internal/observability/collector/collector_option_test.go @@ -64,7 +64,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -177,7 +177,7 @@ func TestWithDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -290,7 +290,7 @@ func TestWithMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -403,7 +403,7 @@ func TestWithVersionInfo(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -516,7 +516,7 @@ func TestWithMemoryMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -629,7 +629,7 @@ func TestWithGoroutineMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -742,7 +742,7 @@ func TestWithCGOMetrics(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/observability/exporter/jaeger/jaeger_option_test.go b/internal/observability/exporter/jaeger/jaeger_option_test.go index 1459b82979..d82c358b30 100644 --- a/internal/observability/exporter/jaeger/jaeger_option_test.go +++ b/internal/observability/exporter/jaeger/jaeger_option_test.go @@ -61,7 +61,7 @@ func TestWithCollectorEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithAgentEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -287,7 +287,7 @@ func TestWithUsername(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -400,7 +400,7 @@ func TestWithPassword(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -513,7 +513,7 @@ func TestWithServiceName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -626,7 +626,7 @@ func TestWithBufferMaxCount(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -739,7 +739,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/observability/exporter/prometheus/prometheus_option_test.go b/internal/observability/exporter/prometheus/prometheus_option_test.go index 97a7069681..1a58d02117 100644 --- a/internal/observability/exporter/prometheus/prometheus_option_test.go +++ b/internal/observability/exporter/prometheus/prometheus_option_test.go @@ -61,7 +61,7 @@ func TestWithEndpoint(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithNamespace(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -287,7 +287,7 @@ func TestWithOnErrorFunc(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/observability/observability_option_test.go b/internal/observability/observability_option_test.go index 8ec1461f3b..c84c8fecca 100644 --- a/internal/observability/observability_option_test.go +++ b/internal/observability/observability_option_test.go @@ -67,7 +67,7 @@ func TestWithErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -180,7 +180,7 @@ func TestWithCollector(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -293,7 +293,7 @@ func TestWithTracer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -406,7 +406,7 @@ func TestWithPrometheus(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -519,7 +519,7 @@ func TestWithJaeger(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/observability/trace/trace_option_test.go b/internal/observability/trace/trace_option_test.go index 27086cc285..0563b8045e 100644 --- a/internal/observability/trace/trace_option_test.go +++ b/internal/observability/trace/trace_option_test.go @@ -61,7 +61,7 @@ func TestWithSamplingRate(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/params/option_test.go b/internal/params/option_test.go index 19166adcca..03f3b809f6 100644 --- a/internal/params/option_test.go +++ b/internal/params/option_test.go @@ -61,7 +61,7 @@ func TestWithConfigFilePathKeys(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -174,7 +174,7 @@ func TestWithConfigFilePathDefault(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -287,7 +287,7 @@ func TestWithConfigFileDescription(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -400,7 +400,7 @@ func TestWithVersionKeys(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -513,7 +513,7 @@ func TestWithVersionFlagDefault(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -626,7 +626,7 @@ func TestWithVersionDescription(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/runner/option_test.go b/internal/runner/option_test.go index c59d6ef265..177e83d2a4 100644 --- a/internal/runner/option_test.go +++ b/internal/runner/option_test.go @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -178,7 +178,7 @@ func TestWithVersion(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -295,7 +295,7 @@ func TestWithConfigLoader(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -408,7 +408,7 @@ func TestWithDaemonInitializer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/safety/safety_test.go b/internal/safety/safety_test.go index 567d7b4b46..1c141c6611 100644 --- a/internal/safety/safety_test.go +++ b/internal/safety/safety_test.go @@ -16,7 +16,6 @@ package safety import ( - "fmt" "testing" "github.com/vdaas/vald/internal/errors" @@ -53,7 +52,7 @@ func TestRecoverFunc(t *testing.T) { { name: "returns error when system paniced caused by panic with error", fn: func() error { - panic(fmt.Errorf("error")) + panic(errors.Errorf("error")) }, want: errors.New("error"), }, diff --git a/internal/servers/server/option_test.go b/internal/servers/server/option_test.go index 24f5fdba56..6bbf8d4361 100644 --- a/internal/servers/server/option_test.go +++ b/internal/servers/server/option_test.go @@ -2355,7 +2355,7 @@ func TestWithPreStopFunction(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/tls/option_test.go b/internal/tls/option_test.go index 73b2cc41fc..d871ecadb7 100644 --- a/internal/tls/option_test.go +++ b/internal/tls/option_test.go @@ -62,7 +62,7 @@ func TestWithCert(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -175,7 +175,7 @@ func TestWithKey(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -288,7 +288,7 @@ func TestWithCa(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -401,7 +401,7 @@ func TestWithTLSConfig(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/worker/queue_option_test.go b/internal/worker/queue_option_test.go index f3707a5232..e08e1ccca4 100644 --- a/internal/worker/queue_option_test.go +++ b/internal/worker/queue_option_test.go @@ -63,7 +63,7 @@ func TestWithQueueBuffer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -176,7 +176,7 @@ func TestWithQueueErrGroup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } @@ -289,7 +289,7 @@ func TestWithQueueCheckDuration(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/internal/worker/worker_option_test.go b/internal/worker/worker_option_test.go index 7b13d1280f..b8df10d160 100644 --- a/internal/worker/worker_option_test.go +++ b/internal/worker/worker_option_test.go @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/agent/ngt/handler/grpc/option_test.go b/pkg/agent/ngt/handler/grpc/option_test.go index 0217e8f4aa..bed6bb771d 100644 --- a/pkg/agent/ngt/handler/grpc/option_test.go +++ b/pkg/agent/ngt/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithNGT(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/agent/ngt/handler/rest/option_test.go b/pkg/agent/ngt/handler/rest/option_test.go index d3404e97ac..9f4f8d0587 100644 --- a/pkg/agent/ngt/handler/rest/option_test.go +++ b/pkg/agent/ngt/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithAgent(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/agent/ngt/router/option_test.go b/pkg/agent/ngt/router/option_test.go index 1e9ddcfb0b..2b60aef4a4 100644 --- a/pkg/agent/ngt/router/option_test.go +++ b/pkg/agent/ngt/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/handler/grpc/option_test.go b/pkg/discoverer/k8s/handler/grpc/option_test.go index 91fe8a44e4..dbbaf01408 100644 --- a/pkg/discoverer/k8s/handler/grpc/option_test.go +++ b/pkg/discoverer/k8s/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/handler/rest/option_test.go b/pkg/discoverer/k8s/handler/rest/option_test.go index 3125c33244..d83836cd00 100644 --- a/pkg/discoverer/k8s/handler/rest/option_test.go +++ b/pkg/discoverer/k8s/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 a4f38b10ea..3ae72f2e83 100644 --- a/pkg/discoverer/k8s/router/option_test.go +++ b/pkg/discoverer/k8s/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/discoverer/k8s/service/option_test.go b/pkg/discoverer/k8s/service/option_test.go index 7395c17971..5a90e39b5f 100644 --- a/pkg/discoverer/k8s/service/option_test.go +++ b/pkg/discoverer/k8s/service/option_test.go @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/handler/grpc/option_test.go b/pkg/gateway/vald/handler/grpc/option_test.go index 60ea050efe..fe13634e25 100644 --- a/pkg/gateway/vald/handler/grpc/option_test.go +++ b/pkg/gateway/vald/handler/grpc/option_test.go @@ -64,7 +64,7 @@ func TestWithGateway(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/handler/rest/option_test.go b/pkg/gateway/vald/handler/rest/option_test.go index d8fe7692d7..3f900a77c5 100644 --- a/pkg/gateway/vald/handler/rest/option_test.go +++ b/pkg/gateway/vald/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithVald(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 b9fd88836f..a0ea7402dd 100644 --- a/pkg/gateway/vald/router/option_test.go +++ b/pkg/gateway/vald/router/option_test.go @@ -63,7 +63,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/backup_option_test.go b/pkg/gateway/vald/service/backup_option_test.go index 72c4ceaf3a..ca7bca08cf 100644 --- a/pkg/gateway/vald/service/backup_option_test.go +++ b/pkg/gateway/vald/service/backup_option_test.go @@ -63,7 +63,7 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/filter_option_test.go b/pkg/gateway/vald/service/filter_option_test.go index dfed870d60..80e30f9c0d 100644 --- a/pkg/gateway/vald/service/filter_option_test.go +++ b/pkg/gateway/vald/service/filter_option_test.go @@ -63,7 +63,7 @@ func TestWithFilterClient(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/gateway_option_test.go b/pkg/gateway/vald/service/gateway_option_test.go index 7440c53031..7a4c8cea02 100644 --- a/pkg/gateway/vald/service/gateway_option_test.go +++ b/pkg/gateway/vald/service/gateway_option_test.go @@ -64,7 +64,7 @@ func TestWithDiscoverer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/gateway/vald/service/meta_option_test.go b/pkg/gateway/vald/service/meta_option_test.go index f00fc245c4..4aa3136999 100644 --- a/pkg/gateway/vald/service/meta_option_test.go +++ b/pkg/gateway/vald/service/meta_option_test.go @@ -64,7 +64,7 @@ func TestWithMetaAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 f5a69df471..21a09c4198 100644 --- a/pkg/manager/backup/cassandra/handler/grpc/option_test.go +++ b/pkg/manager/backup/cassandra/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 cb8c38c735..b5d3617842 100644 --- a/pkg/manager/backup/cassandra/handler/rest/option_test.go +++ b/pkg/manager/backup/cassandra/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 dc5ef1d248..1d2af22405 100644 --- a/pkg/manager/backup/cassandra/router/option_test.go +++ b/pkg/manager/backup/cassandra/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 ae8d5512b5..d124bdd810 100644 --- a/pkg/manager/backup/mysql/handler/grpc/option_test.go +++ b/pkg/manager/backup/mysql/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithMySQL(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 cb8c38c735..b5d3617842 100644 --- a/pkg/manager/backup/mysql/handler/rest/option_test.go +++ b/pkg/manager/backup/mysql/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/backup/mysql/router/option_test.go b/pkg/manager/backup/mysql/router/option_test.go index 098fa9c612..1dc61e54ad 100644 --- a/pkg/manager/backup/mysql/router/option_test.go +++ b/pkg/manager/backup/mysql/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/handler/grpc/option_test.go b/pkg/manager/compressor/handler/grpc/option_test.go index ef7945ebfc..9fe91048ce 100644 --- a/pkg/manager/compressor/handler/grpc/option_test.go +++ b/pkg/manager/compressor/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithCompressor(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/handler/rest/option_test.go b/pkg/manager/compressor/handler/rest/option_test.go index 9694543e9e..3439b09ad9 100644 --- a/pkg/manager/compressor/handler/rest/option_test.go +++ b/pkg/manager/compressor/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 c5bd155530..0669555dbd 100644 --- a/pkg/manager/compressor/router/option_test.go +++ b/pkg/manager/compressor/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/backup_option_test.go b/pkg/manager/compressor/service/backup_option_test.go index 72c4ceaf3a..ca7bca08cf 100644 --- a/pkg/manager/compressor/service/backup_option_test.go +++ b/pkg/manager/compressor/service/backup_option_test.go @@ -63,7 +63,7 @@ func TestWithBackupAddr(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/compress_option_test.go b/pkg/manager/compressor/service/compress_option_test.go index 178b006c89..ba4fc64082 100644 --- a/pkg/manager/compressor/service/compress_option_test.go +++ b/pkg/manager/compressor/service/compress_option_test.go @@ -64,7 +64,7 @@ func TestWithCompressAlgorithm(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/compressor/service/registerer_option_test.go b/pkg/manager/compressor/service/registerer_option_test.go index 4625926239..181276104f 100644 --- a/pkg/manager/compressor/service/registerer_option_test.go +++ b/pkg/manager/compressor/service/registerer_option_test.go @@ -65,7 +65,7 @@ func TestWithRegistererWorker(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/index/handler/grpc/option_test.go b/pkg/manager/index/handler/grpc/option_test.go index 81d914eb23..6a31db6af8 100644 --- a/pkg/manager/index/handler/grpc/option_test.go +++ b/pkg/manager/index/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/index/handler/rest/option_test.go b/pkg/manager/index/handler/rest/option_test.go index 42689be6d6..7397d7d9b7 100644 --- a/pkg/manager/index/handler/rest/option_test.go +++ b/pkg/manager/index/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithIndexer(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 466a925aa7..d3268d211e 100644 --- a/pkg/manager/index/router/option_test.go +++ b/pkg/manager/index/router/option_test.go @@ -63,7 +63,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/index/service/option_test.go b/pkg/manager/index/service/option_test.go index 6247a8371b..f15ca1eb4f 100644 --- a/pkg/manager/index/service/option_test.go +++ b/pkg/manager/index/service/option_test.go @@ -64,7 +64,7 @@ func TestWithIndexingConcurrency(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 cb8c38c735..b5d3617842 100644 --- a/pkg/manager/replication/agent/handler/rest/option_test.go +++ b/pkg/manager/replication/agent/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithBackup(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 04bbfbb406..5ae48eea0b 100644 --- a/pkg/manager/replication/agent/router/option_test.go +++ b/pkg/manager/replication/agent/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 5a4d0f204b..7c14018f56 100644 --- a/pkg/manager/replication/controller/handler/grpc/option_test.go +++ b/pkg/manager/replication/controller/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 65cbe15b3e..421ccca1ad 100644 --- a/pkg/manager/replication/controller/handler/rest/option_test.go +++ b/pkg/manager/replication/controller/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithReplicator(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 277dee1a9e..86a5027faf 100644 --- a/pkg/manager/replication/controller/router/option_test.go +++ b/pkg/manager/replication/controller/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/manager/replication/controller/service/option_test.go b/pkg/manager/replication/controller/service/option_test.go index f5a7d21d8b..9c2acb8190 100644 --- a/pkg/manager/replication/controller/service/option_test.go +++ b/pkg/manager/replication/controller/service/option_test.go @@ -63,7 +63,7 @@ func TestWithName(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/meta/cassandra/handler/grpc/option_test.go b/pkg/meta/cassandra/handler/grpc/option_test.go index c6369e4345..a5b3405d58 100644 --- a/pkg/meta/cassandra/handler/grpc/option_test.go +++ b/pkg/meta/cassandra/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithCassandra(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/meta/cassandra/handler/rest/option_test.go b/pkg/meta/cassandra/handler/rest/option_test.go index 64cbcbfdf9..05332a9e04 100644 --- a/pkg/meta/cassandra/handler/rest/option_test.go +++ b/pkg/meta/cassandra/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 3934edae8a..538c433342 100644 --- a/pkg/meta/cassandra/router/option_test.go +++ b/pkg/meta/cassandra/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/meta/redis/handler/grpc/option_test.go b/pkg/meta/redis/handler/grpc/option_test.go index 5f70cec213..39467c2391 100644 --- a/pkg/meta/redis/handler/grpc/option_test.go +++ b/pkg/meta/redis/handler/grpc/option_test.go @@ -63,7 +63,7 @@ func TestWithRedis(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil } diff --git a/pkg/meta/redis/handler/rest/option_test.go b/pkg/meta/redis/handler/rest/option_test.go index 64cbcbfdf9..05332a9e04 100644 --- a/pkg/meta/redis/handler/rest/option_test.go +++ b/pkg/meta/redis/handler/rest/option_test.go @@ -63,7 +63,7 @@ func TestWithMeta(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %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 62a3f92cb0..7af33f2a43 100644 --- a/pkg/meta/redis/router/option_test.go +++ b/pkg/meta/redis/router/option_test.go @@ -64,7 +64,7 @@ func TestWithHandler(t *testing.T) { /* defaultCheckFunc := func(w want, obj *T) error { if !reflect.DeepEqual(obj, w.obj) { - return fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } 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 fmt.Errorf("got = %v, want %v", obj, w.c) + return errors.Errorf("got = %v, want %v", obj, w.c) } return nil }