From 378e754c88355ae87b54477dd9deabee3f878b73 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 May 2025 12:36:14 +0200 Subject: [PATCH] use consistent alias for gotest.tools/v3/assert/cmp Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/candidate_test.go | 4 ++-- cli/context/store/metadata_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli-plugins/manager/candidate_test.go b/cli-plugins/manager/candidate_test.go index dc0e960f63..e8df429099 100644 --- a/cli-plugins/manager/candidate_test.go +++ b/cli-plugins/manager/candidate_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/cli-plugins/metadata" "github.com/spf13/cobra" "gotest.tools/v3/assert" - "gotest.tools/v3/assert/cmp" + is "gotest.tools/v3/assert/cmp" ) type fakeCandidate struct { @@ -81,7 +81,7 @@ func TestValidateCandidate(t *testing.T) { assert.ErrorContains(t, err, tc.err) case tc.invalid != "": assert.NilError(t, err) - assert.Assert(t, cmp.ErrorType(p.Err, reflect.TypeOf(&pluginError{}))) + assert.Assert(t, is.ErrorType(p.Err, reflect.TypeOf(&pluginError{}))) assert.ErrorContains(t, p.Err, tc.invalid) default: assert.NilError(t, err) diff --git a/cli/context/store/metadata_test.go b/cli/context/store/metadata_test.go index baedb7735e..b92ee30276 100644 --- a/cli/context/store/metadata_test.go +++ b/cli/context/store/metadata_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/errdefs" "gotest.tools/v3/assert" - "gotest.tools/v3/assert/cmp" + is "gotest.tools/v3/assert/cmp" ) func testMetadata(name string) Metadata { @@ -69,8 +69,8 @@ func TestMetadataRespectJsonAnnotation(t *testing.T) { assert.NilError(t, testee.createOrUpdate(testMetadata("test"))) bytes, err := os.ReadFile(filepath.Join(testDir, string(contextdirOf("test")), "meta.json")) assert.NilError(t, err) - assert.Assert(t, cmp.Contains(string(bytes), "a_very_recognizable_field_name")) - assert.Assert(t, cmp.Contains(string(bytes), "another_very_recognizable_field_name")) + assert.Assert(t, is.Contains(string(bytes), "a_very_recognizable_field_name")) + assert.Assert(t, is.Contains(string(bytes), "another_very_recognizable_field_name")) } func TestMetadataList(t *testing.T) {