From 4fe6b837b71817eac1dbcac863ea6f1bbe3d4c61 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 22 Feb 2020 18:12:14 +0100 Subject: [PATCH] bump gotest.tools v3.0.1 for compatibility with Go 1.14 full diff: https://github.com/gotestyourself/gotest.tools/compare/v2.3.0...v3.0.1 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 2c0e93063bc61dae2e96455186e99fe1c56c85f5) Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/candidate_test.go | 4 +- cli-plugins/manager/error_test.go | 2 +- cli-plugins/manager/manager_test.go | 4 +- cli/cobra_test.go | 4 +- cli/command/bundlefile/bundlefile_test.go | 4 +- cli/command/checkpoint/create_test.go | 4 +- cli/command/checkpoint/formatter_test.go | 2 +- cli/command/checkpoint/list_test.go | 6 +- cli/command/checkpoint/remove_test.go | 4 +- cli/command/cli_options_test.go | 2 +- cli/command/cli_test.go | 8 +-- cli/command/config/create_test.go | 6 +- cli/command/config/formatter_test.go | 4 +- cli/command/config/inspect_test.go | 4 +- cli/command/config/ls_test.go | 6 +- cli/command/config/remove_test.go | 4 +- cli/command/container/attach_test.go | 2 +- cli/command/container/cp_test.go | 8 +-- cli/command/container/create_test.go | 8 +-- cli/command/container/exec_test.go | 4 +- cli/command/container/export_test.go | 4 +- cli/command/container/formatter_diff_test.go | 4 +- cli/command/container/formatter_stats_test.go | 4 +- cli/command/container/list_test.go | 4 +- cli/command/container/logs_test.go | 4 +- cli/command/container/opts_test.go | 6 +- cli/command/container/ps_test.go | 4 +- cli/command/container/run_test.go | 4 +- cli/command/container/stats_helpers_test.go | 2 +- cli/command/container/tty_test.go | 4 +- cli/command/container/utils_test.go | 4 +- cli/command/context/create_test.go | 4 +- cli/command/context/export-import_test.go | 2 +- cli/command/context/inspect_test.go | 4 +- cli/command/context/list_test.go | 6 +- cli/command/context/remove_test.go | 2 +- cli/command/context/update_test.go | 4 +- cli/command/context/use_test.go | 2 +- cli/command/defaultcontextstore_test.go | 6 +- cli/command/engine/activate_test.go | 6 +- cli/command/engine/check_test.go | 4 +- cli/command/engine/cmd_test.go | 2 +- cli/command/engine/licenses_test.go | 4 +- cli/command/engine/update_test.go | 2 +- cli/command/engine/updates_test.go | 4 +- cli/command/formatter/container_test.go | 6 +- cli/command/formatter/disk_usage_test.go | 6 +- cli/command/formatter/displayutils_test.go | 4 +- cli/command/formatter/image_test.go | 4 +- cli/command/formatter/volume_test.go | 4 +- cli/command/idresolver/idresolver_test.go | 4 +- cli/command/image/build/context_test.go | 4 +- cli/command/image/build_test.go | 6 +- cli/command/image/formatter_history_test.go | 4 +- cli/command/image/history_test.go | 6 +- cli/command/image/import_test.go | 4 +- cli/command/image/inspect_test.go | 6 +- cli/command/image/list_test.go | 6 +- cli/command/image/load_test.go | 4 +- cli/command/image/prune_test.go | 6 +- cli/command/image/pull_test.go | 6 +- cli/command/image/push_test.go | 2 +- cli/command/image/remove_test.go | 6 +- cli/command/image/save_test.go | 4 +- cli/command/image/tag_test.go | 4 +- cli/command/image/trust_test.go | 2 +- cli/command/inspect/inspector_test.go | 4 +- cli/command/manifest/annotate_test.go | 6 +- cli/command/manifest/create_test.go | 6 +- cli/command/manifest/inspect_test.go | 6 +- cli/command/manifest/push_test.go | 2 +- cli/command/network/connect_test.go | 4 +- cli/command/network/create_test.go | 4 +- cli/command/network/disconnect_test.go | 2 +- cli/command/network/formatter_test.go | 4 +- cli/command/network/list_test.go | 6 +- cli/command/node/demote_test.go | 2 +- cli/command/node/formatter_test.go | 4 +- cli/command/node/inspect_test.go | 4 +- cli/command/node/list_test.go | 6 +- cli/command/node/promote_test.go | 2 +- cli/command/node/ps_test.go | 4 +- cli/command/node/remove_test.go | 2 +- cli/command/node/update_test.go | 2 +- cli/command/orchestrator_test.go | 6 +- cli/command/plugin/create_test.go | 6 +- cli/command/plugin/disable_test.go | 4 +- cli/command/plugin/enable_test.go | 4 +- cli/command/plugin/formatter_test.go | 4 +- cli/command/plugin/inspect_test.go | 4 +- cli/command/plugin/install_test.go | 2 +- cli/command/plugin/list_test.go | 6 +- cli/command/plugin/remove_test.go | 4 +- cli/command/registry/formatter_search_test.go | 6 +- cli/command/registry/login_test.go | 6 +- cli/command/registry_test.go | 4 +- cli/command/secret/create_test.go | 4 +- cli/command/secret/formatter_test.go | 4 +- cli/command/secret/inspect_test.go | 4 +- cli/command/secret/ls_test.go | 6 +- cli/command/secret/remove_test.go | 4 +- cli/command/service/create_test.go | 4 +- cli/command/service/formatter_test.go | 6 +- .../service/generic_resource_opts_test.go | 4 +- cli/command/service/inspect_test.go | 4 +- cli/command/service/list_test.go | 4 +- cli/command/service/opts_test.go | 4 +- cli/command/service/progress/progress_test.go | 4 +- cli/command/service/ps_test.go | 4 +- cli/command/service/rollback_test.go | 4 +- cli/command/service/update_test.go | 4 +- cli/command/stack/deploy_test.go | 2 +- cli/command/stack/formatter/formatter_test.go | 4 +- .../stack/kubernetes/conversion_test.go | 2 +- cli/command/stack/kubernetes/convert_test.go | 4 +- cli/command/stack/kubernetes/deploy_test.go | 2 +- cli/command/stack/kubernetes/services_test.go | 4 +- .../stack/kubernetes/stackclient_test.go | 2 +- cli/command/stack/kubernetes/warnings_test.go | 2 +- cli/command/stack/kubernetes/watcher_test.go | 2 +- cli/command/stack/list_test.go | 4 +- cli/command/stack/loader/loader_test.go | 6 +- cli/command/stack/ps_test.go | 6 +- cli/command/stack/remove_test.go | 4 +- cli/command/stack/services_test.go | 6 +- .../stack/swarm/deploy_bundlefile_test.go | 4 +- .../stack/swarm/deploy_composefile_test.go | 2 +- cli/command/stack/swarm/deploy_test.go | 4 +- cli/command/swarm/ca_test.go | 4 +- cli/command/swarm/init_test.go | 4 +- cli/command/swarm/join_test.go | 4 +- cli/command/swarm/join_token_test.go | 4 +- cli/command/swarm/leave_test.go | 4 +- cli/command/swarm/opts_test.go | 4 +- cli/command/swarm/unlock_key_test.go | 4 +- cli/command/swarm/unlock_test.go | 2 +- cli/command/swarm/update_test.go | 4 +- cli/command/system/info_test.go | 6 +- cli/command/system/prune_test.go | 4 +- cli/command/system/version_test.go | 6 +- cli/command/task/formatter_test.go | 6 +- cli/command/task/print_test.go | 4 +- cli/command/trust/common_test.go | 4 +- cli/command/trust/formatter_test.go | 4 +- cli/command/trust/helpers_test.go | 2 +- cli/command/trust/inspect_pretty_test.go | 6 +- cli/command/trust/inspect_test.go | 4 +- cli/command/trust/key_generate_test.go | 4 +- cli/command/trust/key_load_test.go | 6 +- cli/command/trust/revoke_test.go | 4 +- cli/command/trust/sign_test.go | 6 +- cli/command/trust/signer_add_test.go | 4 +- cli/command/trust/signer_remove_test.go | 4 +- cli/command/utils_test.go | 2 +- cli/command/volume/create_test.go | 4 +- cli/command/volume/inspect_test.go | 4 +- cli/command/volume/list_test.go | 4 +- cli/command/volume/prune_test.go | 6 +- cli/command/volume/remove_test.go | 2 +- cli/compose/convert/compose_test.go | 6 +- cli/compose/convert/service_test.go | 4 +- cli/compose/convert/volume_test.go | 4 +- .../interpolation/interpolation_test.go | 6 +- cli/compose/loader/loader_test.go | 4 +- cli/compose/loader/merge_test.go | 2 +- cli/compose/loader/types_test.go | 4 +- cli/compose/loader/volume_test.go | 4 +- cli/compose/schema/schema_test.go | 2 +- cli/compose/template/template_test.go | 4 +- cli/config/config_test.go | 4 +- cli/config/configfile/file_test.go | 6 +- cli/config/credentials/file_store_test.go | 4 +- cli/config/credentials/native_store_test.go | 4 +- .../commandconn/commandconn_unix_test.go | 4 +- cli/connhelper/ssh/ssh_test.go | 4 +- cli/context/kubernetes/endpoint_test.go | 2 +- cli/context/kubernetes/load_test.go | 4 +- cli/context/store/io_utils_test.go | 2 +- cli/context/store/metadata_test.go | 4 +- cli/context/store/store_test.go | 2 +- cli/context/store/storeconfig_test.go | 2 +- cli/context/store/tlsstore_test.go | 2 +- cli/flags/common_test.go | 4 +- cli/manifest/store/store_test.go | 4 +- cli/required_test.go | 2 +- cli/trust/trust_test.go | 4 +- cmd/docker/docker_test.go | 4 +- e2e/cli-plugins/config_test.go | 4 +- e2e/cli-plugins/dial_test.go | 6 +- e2e/cli-plugins/flags_test.go | 2 +- e2e/cli-plugins/help_test.go | 6 +- e2e/cli-plugins/run_test.go | 8 +-- e2e/cli-plugins/util_test.go | 6 +- e2e/container/attach_test.go | 2 +- e2e/container/create_test.go | 4 +- e2e/container/kill_test.go | 4 +- e2e/container/proxy_signal_test.go | 6 +- e2e/container/run_test.go | 10 +-- e2e/context/context_test.go | 4 +- e2e/image/build_test.go | 10 +-- e2e/image/pull_test.go | 10 +-- e2e/image/push_test.go | 10 +-- e2e/internal/fixtures/fixtures.go | 4 +- e2e/plugin/trust_test.go | 8 +-- e2e/stack/deploy_test.go | 8 +-- e2e/stack/help_test.go | 4 +- e2e/stack/remove_test.go | 8 +-- e2e/system/inspect_test.go | 2 +- e2e/trust/revoke_test.go | 10 +-- e2e/trust/sign_test.go | 10 +-- .../containerizedengine/containerd_test.go | 2 +- internal/containerizedengine/update_test.go | 2 +- internal/licenseutils/utils_test.go | 2 +- internal/pkg/containerized/hostpaths_test.go | 2 +- internal/test/environment/testenv.go | 6 +- internal/test/strings.go | 4 +- internal/versions/versions_test.go | 2 +- kubernetes/check_test.go | 4 +- opts/duration_test.go | 4 +- opts/gpus_test.go | 4 +- opts/mount_test.go | 4 +- opts/network_test.go | 4 +- opts/opts_test.go | 2 +- opts/port_test.go | 4 +- opts/quotedstring_test.go | 4 +- opts/secret_test.go | 4 +- service/logs/parse_logs_test.go | 4 +- templates/templates_test.go | 4 +- vendor.conf | 2 +- vendor/gotest.tools/go.mod | 8 --- vendor/gotest.tools/{ => v3}/LICENSE | 0 vendor/gotest.tools/{ => v3}/README.md | 31 ++++++--- vendor/gotest.tools/{ => v3}/assert/assert.go | 65 +++++++++++-------- .../{ => v3}/assert/cmp/compare.go | 35 ++++++---- .../{ => v3}/assert/cmp/result.go | 2 +- vendor/gotest.tools/{ => v3}/assert/result.go | 6 +- vendor/gotest.tools/{ => v3}/env/env.go | 44 +++++++------ vendor/gotest.tools/{ => v3}/fs/file.go | 23 ++++--- vendor/gotest.tools/{ => v3}/fs/manifest.go | 2 +- .../gotest.tools/{ => v3}/fs/manifest_unix.go | 0 .../{ => v3}/fs/manifest_windows.go | 0 vendor/gotest.tools/{ => v3}/fs/ops.go | 19 +++++- vendor/gotest.tools/{ => v3}/fs/path.go | 6 +- vendor/gotest.tools/{ => v3}/fs/report.go | 8 +-- vendor/gotest.tools/v3/go.mod | 10 +++ vendor/gotest.tools/{ => v3}/golden/golden.go | 59 ++++++++++++----- vendor/gotest.tools/{ => v3}/icmd/command.go | 22 ++++--- vendor/gotest.tools/{ => v3}/icmd/exitcode.go | 0 vendor/gotest.tools/{ => v3}/icmd/ops.go | 8 +++ .../v3/internal/cleanup/cleanup.go | 45 +++++++++++++ .../{ => v3}/internal/difflib/LICENSE | 0 .../{ => v3}/internal/difflib/difflib.go | 2 +- .../{ => v3}/internal/format/diff.go | 2 +- .../{ => v3}/internal/format/format.go | 2 +- .../{ => v3}/internal/source/defers.go | 0 .../{ => v3}/internal/source/source.go | 14 ++-- vendor/gotest.tools/{ => v3}/poll/check.go | 0 vendor/gotest.tools/{ => v3}/poll/poll.go | 2 +- vendor/gotest.tools/{ => v3}/skip/skip.go | 6 +- .../{ => v3}/x/subtest/context.go | 11 ++-- 260 files changed, 781 insertions(+), 627 deletions(-) delete mode 100644 vendor/gotest.tools/go.mod rename vendor/gotest.tools/{ => v3}/LICENSE (100%) rename vendor/gotest.tools/{ => v3}/README.md (68%) rename vendor/gotest.tools/{ => v3}/assert/assert.go (81%) rename vendor/gotest.tools/{ => v3}/assert/cmp/compare.go (92%) rename vendor/gotest.tools/{ => v3}/assert/cmp/result.go (98%) rename vendor/gotest.tools/{ => v3}/assert/result.go (95%) rename vendor/gotest.tools/{ => v3}/env/env.go (73%) rename vendor/gotest.tools/{ => v3}/fs/file.go (83%) rename vendor/gotest.tools/{ => v3}/fs/manifest.go (99%) rename vendor/gotest.tools/{ => v3}/fs/manifest_unix.go (100%) rename vendor/gotest.tools/{ => v3}/fs/manifest_windows.go (100%) rename vendor/gotest.tools/{ => v3}/fs/ops.go (94%) rename vendor/gotest.tools/{ => v3}/fs/path.go (98%) rename vendor/gotest.tools/{ => v3}/fs/report.go (97%) create mode 100644 vendor/gotest.tools/v3/go.mod rename vendor/gotest.tools/{ => v3}/golden/golden.go (67%) rename vendor/gotest.tools/{ => v3}/icmd/command.go (95%) rename vendor/gotest.tools/{ => v3}/icmd/exitcode.go (100%) rename vendor/gotest.tools/{ => v3}/icmd/ops.go (81%) create mode 100644 vendor/gotest.tools/v3/internal/cleanup/cleanup.go rename vendor/gotest.tools/{ => v3}/internal/difflib/LICENSE (100%) rename vendor/gotest.tools/{ => v3}/internal/difflib/difflib.go (99%) rename vendor/gotest.tools/{ => v3}/internal/format/diff.go (99%) rename vendor/gotest.tools/{ => v3}/internal/format/format.go (91%) rename vendor/gotest.tools/{ => v3}/internal/source/defers.go (100%) rename vendor/gotest.tools/{ => v3}/internal/source/source.go (91%) rename vendor/gotest.tools/{ => v3}/poll/check.go (100%) rename vendor/gotest.tools/{ => v3}/poll/poll.go (98%) rename vendor/gotest.tools/{ => v3}/skip/skip.go (95%) rename vendor/gotest.tools/{ => v3}/x/subtest/context.go (85%) diff --git a/cli-plugins/manager/candidate_test.go b/cli-plugins/manager/candidate_test.go index a8cf2ab498..13f3317018 100644 --- a/cli-plugins/manager/candidate_test.go +++ b/cli-plugins/manager/candidate_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/spf13/cobra" - "gotest.tools/assert" - "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" ) type fakeCandidate struct { diff --git a/cli-plugins/manager/error_test.go b/cli-plugins/manager/error_test.go index 04614e24ff..bc318251ba 100644 --- a/cli-plugins/manager/error_test.go +++ b/cli-plugins/manager/error_test.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" "gopkg.in/yaml.v2" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestPluginError(t *testing.T) { diff --git a/cli-plugins/manager/manager_test.go b/cli-plugins/manager/manager_test.go index d727fdac8a..cbe0367028 100644 --- a/cli-plugins/manager/manager_test.go +++ b/cli-plugins/manager/manager_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - "gotest.tools/fs" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" ) func TestListPluginCandidates(t *testing.T) { diff --git a/cli/cobra_test.go b/cli/cobra_test.go index 5fe8f5d98c..18ce31ca2e 100644 --- a/cli/cobra_test.go +++ b/cli/cobra_test.go @@ -6,8 +6,8 @@ import ( pluginmanager "github.com/docker/cli/cli-plugins/manager" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/cobra" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestVisitAll(t *testing.T) { diff --git a/cli/command/bundlefile/bundlefile_test.go b/cli/command/bundlefile/bundlefile_test.go index cbaa341cd7..6321e09ab4 100644 --- a/cli/command/bundlefile/bundlefile_test.go +++ b/cli/command/bundlefile/bundlefile_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestLoadFileV01Success(t *testing.T) { diff --git a/cli/command/checkpoint/create_test.go b/cli/command/checkpoint/create_test.go index 70c6aad7e7..4c10e5f2aa 100644 --- a/cli/command/checkpoint/create_test.go +++ b/cli/command/checkpoint/create_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCheckpointCreateErrors(t *testing.T) { diff --git a/cli/command/checkpoint/formatter_test.go b/cli/command/checkpoint/formatter_test.go index 7256b2fbda..e94b78f999 100644 --- a/cli/command/checkpoint/formatter_test.go +++ b/cli/command/checkpoint/formatter_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestCheckpointContextFormatWrite(t *testing.T) { diff --git a/cli/command/checkpoint/list_test.go b/cli/command/checkpoint/list_test.go index 986d3ee469..8e1008b7b1 100644 --- a/cli/command/checkpoint/list_test.go +++ b/cli/command/checkpoint/list_test.go @@ -7,9 +7,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestCheckpointListErrors(t *testing.T) { diff --git a/cli/command/checkpoint/remove_test.go b/cli/command/checkpoint/remove_test.go index d1a9ac4bce..b941581341 100644 --- a/cli/command/checkpoint/remove_test.go +++ b/cli/command/checkpoint/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCheckpointRemoveErrors(t *testing.T) { diff --git a/cli/command/cli_options_test.go b/cli/command/cli_options_test.go index 10dcad8b3d..0085023913 100644 --- a/cli/command/cli_options_test.go +++ b/cli/command/cli_options_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func contentTrustEnabled(t *testing.T) bool { diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index dcff1bb569..aea4afb463 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -19,10 +19,10 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/env" - "gotest.tools/fs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/env" + "gotest.tools/v3/fs" ) func TestNewAPIClientFromFlags(t *testing.T) { diff --git a/cli/command/config/create_test.go b/cli/command/config/create_test.go index bb2ea946d7..062f676536 100644 --- a/cli/command/config/create_test.go +++ b/cli/command/config/create_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) const configDataFile = "config-create-with-name.golden" diff --git a/cli/command/config/formatter_test.go b/cli/command/config/formatter_test.go index aa8de73cbf..f4d9b5878a 100644 --- a/cli/command/config/formatter_test.go +++ b/cli/command/config/formatter_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestConfigContextFormatWrite(t *testing.T) { diff --git a/cli/command/config/inspect_test.go b/cli/command/config/inspect_test.go index d174b0c502..67cf056376 100644 --- a/cli/command/config/inspect_test.go +++ b/cli/command/config/inspect_test.go @@ -10,8 +10,8 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestConfigInspectErrors(t *testing.T) { diff --git a/cli/command/config/ls_test.go b/cli/command/config/ls_test.go index 4677b068e7..78c4d54f45 100644 --- a/cli/command/config/ls_test.go +++ b/cli/command/config/ls_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestConfigListErrors(t *testing.T) { diff --git a/cli/command/config/remove_test.go b/cli/command/config/remove_test.go index 4a1980bc80..b7676d2e3b 100644 --- a/cli/command/config/remove_test.go +++ b/cli/command/config/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestConfigRemoveErrors(t *testing.T) { diff --git a/cli/command/container/attach_test.go b/cli/command/container/attach_test.go index 7d8d3f6edf..37b5066023 100644 --- a/cli/command/container/attach_test.go +++ b/cli/command/container/attach_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNewAttachCommandErrors(t *testing.T) { diff --git a/cli/command/container/cp_test.go b/cli/command/container/cp_test.go index f08b7ee520..f599049d05 100644 --- a/cli/command/container/cp_test.go +++ b/cli/command/container/cp_test.go @@ -11,10 +11,10 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/archive" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" + "gotest.tools/v3/skip" ) func TestRunCopyWithInvalidArguments(t *testing.T) { diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index 544943db19..1fd9545467 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -19,10 +19,10 @@ import ( "github.com/docker/docker/api/types/network" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" + "gotest.tools/v3/golden" ) func TestCIDFileNoOPWithNoFilename(t *testing.T) { diff --git a/cli/command/container/exec_test.go b/cli/command/container/exec_test.go index 0c6e2614b9..80cb985618 100644 --- a/cli/command/container/exec_test.go +++ b/cli/command/container/exec_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/cli/opts" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func withDefaultOpts(options execOptions) execOptions { diff --git a/cli/command/container/export_test.go b/cli/command/container/export_test.go index 340d55e10e..7ebc3d41b3 100644 --- a/cli/command/container/export_test.go +++ b/cli/command/container/export_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - "gotest.tools/fs" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" ) func TestContainerExportOutputToFile(t *testing.T) { diff --git a/cli/command/container/formatter_diff_test.go b/cli/command/container/formatter_diff_test.go index e29e8eade5..531866771d 100644 --- a/cli/command/container/formatter_diff_test.go +++ b/cli/command/container/formatter_diff_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/archive" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestDiffContextFormatWrite(t *testing.T) { diff --git a/cli/command/container/formatter_stats_test.go b/cli/command/container/formatter_stats_test.go index 68e76625ab..5cd0aafcca 100644 --- a/cli/command/container/formatter_stats_test.go +++ b/cli/command/container/formatter_stats_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestContainerStatsContext(t *testing.T) { diff --git a/cli/command/container/list_test.go b/cli/command/container/list_test.go index 310d78020a..1827408faa 100644 --- a/cli/command/container/list_test.go +++ b/cli/command/container/list_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestContainerListErrors(t *testing.T) { diff --git a/cli/command/container/logs_test.go b/cli/command/container/logs_test.go index a618ad5e57..23d8973a91 100644 --- a/cli/command/container/logs_test.go +++ b/cli/command/container/logs_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) var logFn = func(expectedOut string) func(string, types.ContainerLogsOptions) (io.ReadCloser, error) { diff --git a/cli/command/container/opts_test.go b/cli/command/container/opts_test.go index 7c08527250..69b5b41f53 100644 --- a/cli/command/container/opts_test.go +++ b/cli/command/container/opts_test.go @@ -14,9 +14,9 @@ import ( "github.com/docker/go-connections/nat" "github.com/pkg/errors" "github.com/spf13/pflag" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/skip" ) func TestValidateAttach(t *testing.T) { diff --git a/cli/command/container/ps_test.go b/cli/command/container/ps_test.go index 28853576fe..4636912245 100644 --- a/cli/command/container/ps_test.go +++ b/cli/command/container/ps_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/docker/cli/opts" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestBuildContainerListOptions(t *testing.T) { diff --git a/cli/command/container/run_test.go b/cli/command/container/run_test.go index eecbe46c4a..268e76c1e0 100644 --- a/cli/command/container/run_test.go +++ b/cli/command/container/run_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test/notary" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestRunLabel(t *testing.T) { diff --git a/cli/command/container/stats_helpers_test.go b/cli/command/container/stats_helpers_test.go index a9657e2e2c..4b7a55f000 100644 --- a/cli/command/container/stats_helpers_test.go +++ b/cli/command/container/stats_helpers_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/docker/docker/api/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestCalculateMemUsageUnixNoCache(t *testing.T) { diff --git a/cli/command/container/tty_test.go b/cli/command/container/tty_test.go index eb2e0bfaab..d29381042a 100644 --- a/cli/command/container/tty_test.go +++ b/cli/command/container/tty_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestInitTtySizeErrors(t *testing.T) { diff --git a/cli/command/container/utils_test.go b/cli/command/container/utils_test.go index 970549c04c..a7151b3346 100644 --- a/cli/command/container/utils_test.go +++ b/cli/command/container/utils_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api" "github.com/docker/docker/api/types/container" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func waitFn(cid string) (<-chan container.ContainerWaitOKBody, <-chan error) { diff --git a/cli/command/context/create_test.go b/cli/command/context/create_test.go index 99af79e5e3..916672daee 100644 --- a/cli/command/context/create_test.go +++ b/cli/command/context/create_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/cli/cli/context/kubernetes" "github.com/docker/cli/cli/context/store" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - "gotest.tools/env" + "gotest.tools/v3/assert" + "gotest.tools/v3/env" ) func makeFakeCli(t *testing.T, opts ...func(*test.FakeCli)) (*test.FakeCli, func()) { diff --git a/cli/command/context/export-import_test.go b/cli/command/context/export-import_test.go index 75fc468bed..bf0cd88527 100644 --- a/cli/command/context/export-import_test.go +++ b/cli/command/context/export-import_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/docker/cli/cli/streams" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestExportImportWithFile(t *testing.T) { diff --git a/cli/command/context/inspect_test.go b/cli/command/context/inspect_test.go index 592206a5bf..5e26c47fcb 100644 --- a/cli/command/context/inspect_test.go +++ b/cli/command/context/inspect_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestInspect(t *testing.T) { diff --git a/cli/command/context/list_test.go b/cli/command/context/list_test.go index df4534dcd3..d628493fc3 100644 --- a/cli/command/context/list_test.go +++ b/cli/command/context/list_test.go @@ -4,9 +4,9 @@ import ( "testing" "github.com/docker/cli/cli/command" - "gotest.tools/assert" - "gotest.tools/env" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/env" + "gotest.tools/v3/golden" ) func createTestContextWithKubeAndSwarm(t *testing.T, cli command.Cli, name string, orchestrator string) { diff --git a/cli/command/context/remove_test.go b/cli/command/context/remove_test.go index 3297cc79ba..bf67c2f5cc 100644 --- a/cli/command/context/remove_test.go +++ b/cli/command/context/remove_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/cli/context/store" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestRemove(t *testing.T) { diff --git a/cli/command/context/update_test.go b/cli/command/context/update_test.go index 68cf75d8eb..34ceff66be 100644 --- a/cli/command/context/update_test.go +++ b/cli/command/context/update_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/context/docker" "github.com/docker/cli/cli/context/kubernetes" - "gotest.tools/assert" - "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" ) func TestUpdateDescriptionOnly(t *testing.T) { diff --git a/cli/command/context/use_test.go b/cli/command/context/use_test.go index 139189af35..26936a4bcc 100644 --- a/cli/command/context/use_test.go +++ b/cli/command/context/use_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/cli/context/store" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestUse(t *testing.T) { diff --git a/cli/command/defaultcontextstore_test.go b/cli/command/defaultcontextstore_test.go index e1c7c1df9b..a2d188b05a 100644 --- a/cli/command/defaultcontextstore_test.go +++ b/cli/command/defaultcontextstore_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/cli/cli/context/store" cliflags "github.com/docker/cli/cli/flags" "github.com/docker/go-connections/tlsconfig" - "gotest.tools/assert" - "gotest.tools/env" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/env" + "gotest.tools/v3/golden" ) type endpoint struct { diff --git a/cli/command/engine/activate_test.go b/cli/command/engine/activate_test.go index 9eff3b8cf0..4da29af12f 100644 --- a/cli/command/engine/activate_test.go +++ b/cli/command/engine/activate_test.go @@ -14,9 +14,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/licensing" "github.com/docker/licensing/model" - "gotest.tools/assert" - "gotest.tools/fs" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" + "gotest.tools/v3/golden" ) const ( diff --git a/cli/command/engine/check_test.go b/cli/command/engine/check_test.go index d1bfd933fc..c653643669 100644 --- a/cli/command/engine/check_test.go +++ b/cli/command/engine/check_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/opencontainers/go-digest" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) var ( diff --git a/cli/command/engine/cmd_test.go b/cli/command/engine/cmd_test.go index 30639cbf3c..12562cacdb 100644 --- a/cli/command/engine/cmd_test.go +++ b/cli/command/engine/cmd_test.go @@ -3,7 +3,7 @@ package engine import ( "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNewEngineCommand(t *testing.T) { diff --git a/cli/command/engine/licenses_test.go b/cli/command/engine/licenses_test.go index bacde70cc7..38280c5c0d 100644 --- a/cli/command/engine/licenses_test.go +++ b/cli/command/engine/licenses_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/cli/internal/licenseutils" "github.com/docker/licensing/model" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSubscriptionContextWrite(t *testing.T) { diff --git a/cli/command/engine/update_test.go b/cli/command/engine/update_test.go index 641b8458c7..11acbf61bb 100644 --- a/cli/command/engine/update_test.go +++ b/cli/command/engine/update_test.go @@ -8,7 +8,7 @@ import ( clitypes "github.com/docker/cli/types" "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestUpdateNoContainerd(t *testing.T) { diff --git a/cli/command/engine/updates_test.go b/cli/command/engine/updates_test.go index 7fb2b0f152..0113b2a52b 100644 --- a/cli/command/engine/updates_test.go +++ b/cli/command/engine/updates_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/cli/command/formatter" clitypes "github.com/docker/cli/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestUpdateContextWrite(t *testing.T) { diff --git a/cli/command/formatter/container_test.go b/cli/command/formatter/container_test.go index 9529c4c1a6..9a280bad3e 100644 --- a/cli/command/formatter/container_test.go +++ b/cli/command/formatter/container_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestContainerPsContext(t *testing.T) { diff --git a/cli/command/formatter/disk_usage_test.go b/cli/command/formatter/disk_usage_test.go index 9a0b829ed1..c16875b9e1 100644 --- a/cli/command/formatter/disk_usage_test.go +++ b/cli/command/formatter/disk_usage_test.go @@ -4,9 +4,9 @@ import ( "bytes" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestDiskUsageContextFormatWrite(t *testing.T) { diff --git a/cli/command/formatter/displayutils_test.go b/cli/command/formatter/displayutils_test.go index db60610bb2..d9ff43daa1 100644 --- a/cli/command/formatter/displayutils_test.go +++ b/cli/command/formatter/displayutils_test.go @@ -3,8 +3,8 @@ package formatter import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestEllipsis(t *testing.T) { diff --git a/cli/command/formatter/image_test.go b/cli/command/formatter/image_test.go index 6df395457f..974230fe4e 100644 --- a/cli/command/formatter/image_test.go +++ b/cli/command/formatter/image_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestImageContext(t *testing.T) { diff --git a/cli/command/formatter/volume_test.go b/cli/command/formatter/volume_test.go index 43c6061d6e..b49c1973c7 100644 --- a/cli/command/formatter/volume_test.go +++ b/cli/command/formatter/volume_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestVolumeContext(t *testing.T) { diff --git a/cli/command/idresolver/idresolver_test.go b/cli/command/idresolver/idresolver_test.go index 4cb6355594..a7b6fc0363 100644 --- a/cli/command/idresolver/idresolver_test.go +++ b/cli/command/idresolver/idresolver_test.go @@ -7,8 +7,8 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestResolveError(t *testing.T) { diff --git a/cli/command/image/build/context_test.go b/cli/command/image/build/context_test.go index 622f8edbd1..f2169781e0 100644 --- a/cli/command/image/build/context_test.go +++ b/cli/command/image/build/context_test.go @@ -13,8 +13,8 @@ import ( "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/fileutils" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) const dockerfileContents = "FROM busybox" diff --git a/cli/command/image/build_test.go b/cli/command/image/build_test.go index 402aa3ae1a..fced1bfca7 100644 --- a/cli/command/image/build_test.go +++ b/cli/command/image/build_test.go @@ -19,9 +19,9 @@ import ( "github.com/docker/docker/pkg/archive" "github.com/google/go-cmp/cmp" "github.com/moby/buildkit/session/secrets/secretsprovider" - "gotest.tools/assert" - "gotest.tools/fs" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" + "gotest.tools/v3/skip" ) func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) { diff --git a/cli/command/image/formatter_history_test.go b/cli/command/image/formatter_history_test.go index fe8e88a82b..ce4c67e9d4 100644 --- a/cli/command/image/formatter_history_test.go +++ b/cli/command/image/formatter_history_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) type historyCase struct { diff --git a/cli/command/image/history_test.go b/cli/command/image/history_test.go index ad2beb9a83..90cceac586 100644 --- a/cli/command/image/history_test.go +++ b/cli/command/image/history_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" + "gotest.tools/v3/skip" ) func TestNewHistoryCommandErrors(t *testing.T) { diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index 9e2fad61fa..6f5e338da0 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNewImportCommandErrors(t *testing.T) { diff --git a/cli/command/image/inspect_test.go b/cli/command/image/inspect_test.go index d881ae0aa3..1f41d8779d 100644 --- a/cli/command/image/inspect_test.go +++ b/cli/command/image/inspect_test.go @@ -7,9 +7,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNewInspectCommandErrors(t *testing.T) { diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 81394a797b..e23c38b899 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNewImagesCommandErrors(t *testing.T) { diff --git a/cli/command/image/load_test.go b/cli/command/image/load_test.go index 5fe4344f6d..eea3d31ee1 100644 --- a/cli/command/image/load_test.go +++ b/cli/command/image/load_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestNewLoadCommandErrors(t *testing.T) { diff --git a/cli/command/image/prune_test.go b/cli/command/image/prune_test.go index 884a485471..2ff5c81e35 100644 --- a/cli/command/image/prune_test.go +++ b/cli/command/image/prune_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNewPruneCommandErrors(t *testing.T) { diff --git a/cli/command/image/pull_test.go b/cli/command/image/pull_test.go index bc0220eeb2..36af9c6e5c 100644 --- a/cli/command/image/pull_test.go +++ b/cli/command/image/pull_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/notary" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNewPullCommandErrors(t *testing.T) { diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 75798aaaf1..88608e61e3 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNewPushCommandErrors(t *testing.T) { diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index 6db2e03187..bdcfedbf06 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) type notFound struct { diff --git a/cli/command/image/save_test.go b/cli/command/image/save_test.go index cc960ba0e0..5e3f8e271c 100644 --- a/cli/command/image/save_test.go +++ b/cli/command/image/save_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNewSaveCommandErrors(t *testing.T) { diff --git a/cli/command/image/tag_test.go b/cli/command/image/tag_test.go index 9c43f3fe77..bb62a5aba2 100644 --- a/cli/command/image/tag_test.go +++ b/cli/command/image/tag_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCliNewTagCommandErrors(t *testing.T) { diff --git a/cli/command/image/trust_test.go b/cli/command/image/trust_test.go index 97585a7299..c5aeffac60 100644 --- a/cli/command/image/trust_test.go +++ b/cli/command/image/trust_test.go @@ -10,7 +10,7 @@ import ( "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustpinning" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func unsetENV() { diff --git a/cli/command/inspect/inspector_test.go b/cli/command/inspect/inspector_test.go index f4df36848d..702df3d8cc 100644 --- a/cli/command/inspect/inspector_test.go +++ b/cli/command/inspect/inspector_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/docker/cli/templates" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) type testElement struct { diff --git a/cli/command/manifest/annotate_test.go b/cli/command/manifest/annotate_test.go index e5cce8f629..a362d53a34 100644 --- a/cli/command/manifest/annotate_test.go +++ b/cli/command/manifest/annotate_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestManifestAnnotateError(t *testing.T) { diff --git a/cli/command/manifest/create_test.go b/cli/command/manifest/create_test.go index fbf0ae7b8f..14222dc262 100644 --- a/cli/command/manifest/create_test.go +++ b/cli/command/manifest/create_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/distribution/reference" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestManifestCreateErrors(t *testing.T) { diff --git a/cli/command/manifest/inspect_test.go b/cli/command/manifest/inspect_test.go index 7abe06d215..2c506841e8 100644 --- a/cli/command/manifest/inspect_test.go +++ b/cli/command/manifest/inspect_test.go @@ -16,9 +16,9 @@ import ( digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func newTempManifestStore(t *testing.T) (store.Store, func()) { diff --git a/cli/command/manifest/push_test.go b/cli/command/manifest/push_test.go index 3a2e9b8a99..311c3e3490 100644 --- a/cli/command/manifest/push_test.go +++ b/cli/command/manifest/push_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/distribution/reference" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func newFakeRegistryClient() *fakeRegistryClient { diff --git a/cli/command/network/connect_test.go b/cli/command/network/connect_test.go index 2c1d040147..1a6958aa8e 100644 --- a/cli/command/network/connect_test.go +++ b/cli/command/network/connect_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/network" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNetworkConnectErrors(t *testing.T) { diff --git a/cli/command/network/create_test.go b/cli/command/network/create_test.go index 6bfa7b65bc..354184f3d4 100644 --- a/cli/command/network/create_test.go +++ b/cli/command/network/create_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNetworkCreateErrors(t *testing.T) { diff --git a/cli/command/network/disconnect_test.go b/cli/command/network/disconnect_test.go index 9a55257051..01bca76510 100644 --- a/cli/command/network/disconnect_test.go +++ b/cli/command/network/disconnect_test.go @@ -7,7 +7,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNetworkDisconnectErrors(t *testing.T) { diff --git a/cli/command/network/formatter_test.go b/cli/command/network/formatter_test.go index 4fd86d8e6c..08685a614e 100644 --- a/cli/command/network/formatter_test.go +++ b/cli/command/network/formatter_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNetworkContext(t *testing.T) { diff --git a/cli/command/network/list_test.go b/cli/command/network/list_test.go index 2f76e517d6..9955a525fc 100644 --- a/cli/command/network/list_test.go +++ b/cli/command/network/list_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNetworkListErrors(t *testing.T) { diff --git a/cli/command/node/demote_test.go b/cli/command/node/demote_test.go index 849cbdc93d..09e067edeb 100644 --- a/cli/command/node/demote_test.go +++ b/cli/command/node/demote_test.go @@ -8,7 +8,7 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package functions "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNodeDemoteErrors(t *testing.T) { diff --git a/cli/command/node/formatter_test.go b/cli/command/node/formatter_test.go index 65e13c33f1..67a4c96510 100644 --- a/cli/command/node/formatter_test.go +++ b/cli/command/node/formatter_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNodeContext(t *testing.T) { diff --git a/cli/command/node/inspect_test.go b/cli/command/node/inspect_test.go index 22be4f475f..f73df761dd 100644 --- a/cli/command/node/inspect_test.go +++ b/cli/command/node/inspect_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestNodeInspectErrors(t *testing.T) { diff --git a/cli/command/node/list_test.go b/cli/command/node/list_test.go index 11e5ff3f60..02fedcd191 100644 --- a/cli/command/node/list_test.go +++ b/cli/command/node/list_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestNodeListErrorOnAPIFailure(t *testing.T) { diff --git a/cli/command/node/promote_test.go b/cli/command/node/promote_test.go index 528180ae00..a0f7b465e2 100644 --- a/cli/command/node/promote_test.go +++ b/cli/command/node/promote_test.go @@ -8,7 +8,7 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNodePromoteErrors(t *testing.T) { diff --git a/cli/command/node/ps_test.go b/cli/command/node/ps_test.go index da4637da61..120d59c247 100644 --- a/cli/command/node/ps_test.go +++ b/cli/command/node/ps_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestNodePsErrors(t *testing.T) { diff --git a/cli/command/node/remove_test.go b/cli/command/node/remove_test.go index 8ae01c7b2f..5c91ec538a 100644 --- a/cli/command/node/remove_test.go +++ b/cli/command/node/remove_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNodeRemoveErrors(t *testing.T) { diff --git a/cli/command/node/update_test.go b/cli/command/node/update_test.go index 00c447b6b2..70d2d02347 100644 --- a/cli/command/node/update_test.go +++ b/cli/command/node/update_test.go @@ -8,7 +8,7 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestNodeUpdateErrors(t *testing.T) { diff --git a/cli/command/orchestrator_test.go b/cli/command/orchestrator_test.go index 141c27e434..fbd9018eff 100644 --- a/cli/command/orchestrator_test.go +++ b/cli/command/orchestrator_test.go @@ -4,9 +4,9 @@ import ( "io/ioutil" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/env" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/env" ) func TestOrchestratorSwitch(t *testing.T) { diff --git a/cli/command/plugin/create_test.go b/cli/command/plugin/create_test.go index bef002c07a..b327f606ce 100644 --- a/cli/command/plugin/create_test.go +++ b/cli/command/plugin/create_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" ) func TestCreateErrors(t *testing.T) { diff --git a/cli/command/plugin/disable_test.go b/cli/command/plugin/disable_test.go index c9292965f7..ab8b6ccea6 100644 --- a/cli/command/plugin/disable_test.go +++ b/cli/command/plugin/disable_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPluginDisableErrors(t *testing.T) { diff --git a/cli/command/plugin/enable_test.go b/cli/command/plugin/enable_test.go index 933ff5de1c..d8aa421ffc 100644 --- a/cli/command/plugin/enable_test.go +++ b/cli/command/plugin/enable_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPluginEnableErrors(t *testing.T) { diff --git a/cli/command/plugin/formatter_test.go b/cli/command/plugin/formatter_test.go index 66853eb99c..2dc9ab8e21 100644 --- a/cli/command/plugin/formatter_test.go +++ b/cli/command/plugin/formatter_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPluginContext(t *testing.T) { diff --git a/cli/command/plugin/inspect_test.go b/cli/command/plugin/inspect_test.go index ac892b5039..e9e34ed38c 100644 --- a/cli/command/plugin/inspect_test.go +++ b/cli/command/plugin/inspect_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) var pluginFoo = &types.Plugin{ diff --git a/cli/command/plugin/install_test.go b/cli/command/plugin/install_test.go index ccd5294ec2..4180a0bfc2 100644 --- a/cli/command/plugin/install_test.go +++ b/cli/command/plugin/install_test.go @@ -11,7 +11,7 @@ import ( "github.com/docker/cli/internal/test/notary" "github.com/docker/docker/api/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestInstallErrors(t *testing.T) { diff --git a/cli/command/plugin/list_test.go b/cli/command/plugin/list_test.go index 75d0c8139c..2a86a6b86e 100644 --- a/cli/command/plugin/list_test.go +++ b/cli/command/plugin/list_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestListErrors(t *testing.T) { diff --git a/cli/command/plugin/remove_test.go b/cli/command/plugin/remove_test.go index 4cfec43341..877483ddbf 100644 --- a/cli/command/plugin/remove_test.go +++ b/cli/command/plugin/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestRemoveErrors(t *testing.T) { diff --git a/cli/command/registry/formatter_search_test.go b/cli/command/registry/formatter_search_test.go index 0feb3ba53c..806e193fba 100644 --- a/cli/command/registry/formatter_search_test.go +++ b/cli/command/registry/formatter_search_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/cli/internal/test" registrytypes "github.com/docker/docker/api/types/registry" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestSearchContext(t *testing.T) { diff --git a/cli/command/registry/login_test.go b/cli/command/registry/login_test.go index 9372a50aec..f523c2eedc 100644 --- a/cli/command/registry/login_test.go +++ b/cli/command/registry/login_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/client" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" ) const userErr = "userunknownError" diff --git a/cli/command/registry_test.go b/cli/command/registry_test.go index a40c10e007..ae7c3ac052 100644 --- a/cli/command/registry_test.go +++ b/cli/command/registry_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" // Prevents a circular import with "github.com/docker/cli/internal/test" diff --git a/cli/command/secret/create_test.go b/cli/command/secret/create_test.go index eb9c089861..a7bdb6b592 100644 --- a/cli/command/secret/create_test.go +++ b/cli/command/secret/create_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) const secretDataFile = "secret-create-with-name.golden" diff --git a/cli/command/secret/formatter_test.go b/cli/command/secret/formatter_test.go index 751e7c3daf..14959095f1 100644 --- a/cli/command/secret/formatter_test.go +++ b/cli/command/secret/formatter_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSecretContextFormatWrite(t *testing.T) { diff --git a/cli/command/secret/inspect_test.go b/cli/command/secret/inspect_test.go index 9224f9b796..e50272f0d8 100644 --- a/cli/command/secret/inspect_test.go +++ b/cli/command/secret/inspect_test.go @@ -10,8 +10,8 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestSecretInspectErrors(t *testing.T) { diff --git a/cli/command/secret/ls_test.go b/cli/command/secret/ls_test.go index 1e6af25a0d..35cc4e3974 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestSecretListErrors(t *testing.T) { diff --git a/cli/command/secret/remove_test.go b/cli/command/secret/remove_test.go index d2fc8ad093..b91a891f33 100644 --- a/cli/command/secret/remove_test.go +++ b/cli/command/secret/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSecretRemoveErrors(t *testing.T) { diff --git a/cli/command/service/create_test.go b/cli/command/service/create_test.go index cd675c7995..1a3d0a11fb 100644 --- a/cli/command/service/create_test.go +++ b/cli/command/service/create_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" cliopts "github.com/docker/cli/opts" ) diff --git a/cli/command/service/formatter_test.go b/cli/command/service/formatter_test.go index 8addeba0c7..73fc0029b2 100644 --- a/cli/command/service/formatter_test.go +++ b/cli/command/service/formatter_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestServiceContextWrite(t *testing.T) { diff --git a/cli/command/service/generic_resource_opts_test.go b/cli/command/service/generic_resource_opts_test.go index c750f1dc88..fbc5fdfa5a 100644 --- a/cli/command/service/generic_resource_opts_test.go +++ b/cli/command/service/generic_resource_opts_test.go @@ -3,8 +3,8 @@ package service import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestValidateSingleGenericResource(t *testing.T) { diff --git a/cli/command/service/inspect_test.go b/cli/command/service/inspect_test.go index fe662ba397..7b31fedf1f 100644 --- a/cli/command/service/inspect_test.go +++ b/cli/command/service/inspect_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func formatServiceInspect(t *testing.T, format formatter.Format, now time.Time) string { diff --git a/cli/command/service/list_test.go b/cli/command/service/list_test.go index e52e7e03c2..44499a30f7 100644 --- a/cli/command/service/list_test.go +++ b/cli/command/service/list_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestServiceListOrder(t *testing.T) { diff --git a/cli/command/service/opts_test.go b/cli/command/service/opts_test.go index 8c27e9f026..a480f9c5c9 100644 --- a/cli/command/service/opts_test.go +++ b/cli/command/service/opts_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCredentialSpecOpt(t *testing.T) { diff --git a/cli/command/service/progress/progress_test.go b/cli/command/service/progress/progress_test.go index 2a386d64f5..d45ba7c289 100644 --- a/cli/command/service/progress/progress_test.go +++ b/cli/command/service/progress/progress_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/progress" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) type mockProgress struct { diff --git a/cli/command/service/ps_test.go b/cli/command/service/ps_test.go index 6459cfcc3b..40b612bff1 100644 --- a/cli/command/service/ps_test.go +++ b/cli/command/service/ps_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" "github.com/google/go-cmp/cmp" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCreateFilter(t *testing.T) { diff --git a/cli/command/service/rollback_test.go b/cli/command/service/rollback_test.go index e61d1c20bb..9c3a8d4461 100644 --- a/cli/command/service/rollback_test.go +++ b/cli/command/service/rollback_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestRollback(t *testing.T) { diff --git a/cli/command/service/update_test.go b/cli/command/service/update_test.go index 9ea293e516..abcbe6958f 100644 --- a/cli/command/service/update_test.go +++ b/cli/command/service/update_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestUpdateServiceArgs(t *testing.T) { diff --git a/cli/command/stack/deploy_test.go b/cli/command/stack/deploy_test.go index 89dbc6e1b7..aa05d25016 100644 --- a/cli/command/stack/deploy_test.go +++ b/cli/command/stack/deploy_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/docker/cli/internal/test" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestDeployWithEmptyName(t *testing.T) { diff --git a/cli/command/stack/formatter/formatter_test.go b/cli/command/stack/formatter/formatter_test.go index 0f2550ea7a..ed878a67a2 100644 --- a/cli/command/stack/formatter/formatter_test.go +++ b/cli/command/stack/formatter/formatter_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/docker/cli/cli/command/formatter" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestStackContextWrite(t *testing.T) { diff --git a/cli/command/stack/kubernetes/conversion_test.go b/cli/command/stack/kubernetes/conversion_test.go index 3a5bd962c4..2cc88678ee 100644 --- a/cli/command/stack/kubernetes/conversion_test.go +++ b/cli/command/stack/kubernetes/conversion_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/cli/cli/command/service" "github.com/docker/compose-on-kubernetes/api/labels" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" + "gotest.tools/v3/assert" appsv1beta2 "k8s.io/api/apps/v1beta2" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/cli/command/stack/kubernetes/convert_test.go b/cli/command/stack/kubernetes/convert_test.go index 05d1748e55..aaab4eb812 100644 --- a/cli/command/stack/kubernetes/convert_test.go +++ b/cli/command/stack/kubernetes/convert_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/compose-on-kubernetes/api/compose/v1alpha3" "github.com/docker/compose-on-kubernetes/api/compose/v1beta1" "github.com/docker/compose-on-kubernetes/api/compose/v1beta2" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/cli/command/stack/kubernetes/deploy_test.go b/cli/command/stack/kubernetes/deploy_test.go index 366ba45ebe..cee1089cc9 100644 --- a/cli/command/stack/kubernetes/deploy_test.go +++ b/cli/command/stack/kubernetes/deploy_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/compose-on-kubernetes/api/compose/v1alpha3" "github.com/docker/compose-on-kubernetes/api/compose/v1beta1" "github.com/docker/compose-on-kubernetes/api/compose/v1beta2" - "gotest.tools/assert" + "gotest.tools/v3/assert" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" diff --git a/cli/command/stack/kubernetes/services_test.go b/cli/command/stack/kubernetes/services_test.go index 5603eeda15..14337ab8e4 100644 --- a/cli/command/stack/kubernetes/services_test.go +++ b/cli/command/stack/kubernetes/services_test.go @@ -5,8 +5,8 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" ) func TestServiceFiltersLabelSelectorGen(t *testing.T) { diff --git a/cli/command/stack/kubernetes/stackclient_test.go b/cli/command/stack/kubernetes/stackclient_test.go index 507a589891..354d8c3897 100644 --- a/cli/command/stack/kubernetes/stackclient_test.go +++ b/cli/command/stack/kubernetes/stackclient_test.go @@ -5,7 +5,7 @@ import ( "testing" composetypes "github.com/docker/cli/cli/compose/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestFromCompose(t *testing.T) { diff --git a/cli/command/stack/kubernetes/warnings_test.go b/cli/command/stack/kubernetes/warnings_test.go index 111fa7bd5e..755f4e6d6a 100644 --- a/cli/command/stack/kubernetes/warnings_test.go +++ b/cli/command/stack/kubernetes/warnings_test.go @@ -6,7 +6,7 @@ import ( "time" composetypes "github.com/docker/cli/cli/compose/types" - "gotest.tools/golden" + "gotest.tools/v3/golden" ) func TestWarnings(t *testing.T) { diff --git a/cli/command/stack/kubernetes/watcher_test.go b/cli/command/stack/kubernetes/watcher_test.go index c02655e8aa..71ba7e44d5 100644 --- a/cli/command/stack/kubernetes/watcher_test.go +++ b/cli/command/stack/kubernetes/watcher_test.go @@ -5,7 +5,7 @@ import ( apiv1beta1 "github.com/docker/compose-on-kubernetes/api/compose/v1beta1" composelabels "github.com/docker/compose-on-kubernetes/api/labels" - "gotest.tools/assert" + "gotest.tools/v3/assert" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/cli/command/stack/list_test.go b/cli/command/stack/list_test.go index 8d792172ac..e898190e5b 100644 --- a/cli/command/stack/list_test.go +++ b/cli/command/stack/list_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) var ( diff --git a/cli/command/stack/loader/loader_test.go b/cli/command/stack/loader/loader_test.go index de524cc527..fd504bc9d1 100644 --- a/cli/command/stack/loader/loader_test.go +++ b/cli/command/stack/loader/loader_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" ) func TestGetConfigDetails(t *testing.T) { diff --git a/cli/command/stack/ps_test.go b/cli/command/stack/ps_test.go index 8e49d193bd..37b0007b3c 100644 --- a/cli/command/stack/ps_test.go +++ b/cli/command/stack/ps_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestStackPsErrors(t *testing.T) { diff --git a/cli/command/stack/remove_test.go b/cli/command/stack/remove_test.go index c7032d845f..a9622647be 100644 --- a/cli/command/stack/remove_test.go +++ b/cli/command/stack/remove_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func fakeClientForRemoveStackTest(version string) *fakeClient { diff --git a/cli/command/stack/services_test.go b/cli/command/stack/services_test.go index 431a675f9d..35526c44bd 100644 --- a/cli/command/stack/services_test.go +++ b/cli/command/stack/services_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestStackServicesErrors(t *testing.T) { diff --git a/cli/command/stack/swarm/deploy_bundlefile_test.go b/cli/command/stack/swarm/deploy_bundlefile_test.go index 485271cbc9..fae2abc8b7 100644 --- a/cli/command/stack/swarm/deploy_bundlefile_test.go +++ b/cli/command/stack/swarm/deploy_bundlefile_test.go @@ -5,8 +5,8 @@ import ( "path/filepath" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestLoadBundlefileErrors(t *testing.T) { diff --git a/cli/command/stack/swarm/deploy_composefile_test.go b/cli/command/stack/swarm/deploy_composefile_test.go index 065a4f2938..ffe0f81f8a 100644 --- a/cli/command/stack/swarm/deploy_composefile_test.go +++ b/cli/command/stack/swarm/deploy_composefile_test.go @@ -7,7 +7,7 @@ import ( "github.com/docker/cli/internal/test/network" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) type notFound struct { diff --git a/cli/command/stack/swarm/deploy_test.go b/cli/command/stack/swarm/deploy_test.go index 970d790bf2..cca29cf826 100644 --- a/cli/command/stack/swarm/deploy_test.go +++ b/cli/command/stack/swarm/deploy_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPruneServices(t *testing.T) { diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index d0eff11647..d20dccfc65 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) const ( diff --git a/cli/command/swarm/init_test.go b/cli/command/swarm/init_test.go index 735cc8da4d..527ce3622d 100644 --- a/cli/command/swarm/init_test.go +++ b/cli/command/swarm/init_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestSwarmInitErrorOnAPIFailure(t *testing.T) { diff --git a/cli/command/swarm/join_test.go b/cli/command/swarm/join_test.go index e70d448db0..3ef970bfa6 100644 --- a/cli/command/swarm/join_test.go +++ b/cli/command/swarm/join_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSwarmJoinErrors(t *testing.T) { diff --git a/cli/command/swarm/join_token_test.go b/cli/command/swarm/join_token_test.go index e34e7da5f0..1a315f355b 100644 --- a/cli/command/swarm/join_token_test.go +++ b/cli/command/swarm/join_token_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestSwarmJoinTokenErrors(t *testing.T) { diff --git a/cli/command/swarm/leave_test.go b/cli/command/swarm/leave_test.go index 91ee6e248e..288363b342 100644 --- a/cli/command/swarm/leave_test.go +++ b/cli/command/swarm/leave_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSwarmLeaveErrors(t *testing.T) { diff --git a/cli/command/swarm/opts_test.go b/cli/command/swarm/opts_test.go index 6382d2a02a..b3c0e8467b 100644 --- a/cli/command/swarm/opts_test.go +++ b/cli/command/swarm/opts_test.go @@ -3,8 +3,8 @@ package swarm import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNodeAddrOptionSetHostAndPort(t *testing.T) { diff --git a/cli/command/swarm/unlock_key_test.go b/cli/command/swarm/unlock_key_test.go index d313c6319f..72ad2bbc36 100644 --- a/cli/command/swarm/unlock_key_test.go +++ b/cli/command/swarm/unlock_key_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestSwarmUnlockKeyErrors(t *testing.T) { diff --git a/cli/command/swarm/unlock_test.go b/cli/command/swarm/unlock_test.go index f576dc34cf..e106e4ed14 100644 --- a/cli/command/swarm/unlock_test.go +++ b/cli/command/swarm/unlock_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestSwarmUnlockErrors(t *testing.T) { diff --git a/cli/command/swarm/update_test.go b/cli/command/swarm/update_test.go index ebddeeec0d..852201cc0e 100644 --- a/cli/command/swarm/update_test.go +++ b/cli/command/swarm/update_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestSwarmUpdateErrors(t *testing.T) { diff --git a/cli/command/system/info_test.go b/cli/command/system/info_test.go index 3e71bab06c..31eb5b1193 100644 --- a/cli/command/system/info_test.go +++ b/cli/command/system/info_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) // helper function that base64 decodes a string and ignores the error diff --git a/cli/command/system/prune_test.go b/cli/command/system/prune_test.go index 761549fcc4..65ceacbee5 100644 --- a/cli/command/system/prune_test.go +++ b/cli/command/system/prune_test.go @@ -5,8 +5,8 @@ import ( "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPrunePromptPre131DoesNotIncludeBuildCache(t *testing.T) { diff --git a/cli/command/system/version_test.go b/cli/command/system/version_test.go index 0a4f47e34a..482c6ce24d 100644 --- a/cli/command/system/version_test.go +++ b/cli/command/system/version_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" diff --git a/cli/command/task/formatter_test.go b/cli/command/task/formatter_test.go index 2de2acc4e5..ad531992d0 100644 --- a/cli/command/task/formatter_test.go +++ b/cli/command/task/formatter_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestTaskContextWrite(t *testing.T) { diff --git a/cli/command/task/print_test.go b/cli/command/task/print_test.go index 5b5c0a81c3..472fc34e5b 100644 --- a/cli/command/task/print_test.go +++ b/cli/command/task/print_test.go @@ -11,8 +11,8 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestTaskPrintWithQuietOption(t *testing.T) { diff --git a/cli/command/trust/common_test.go b/cli/command/trust/common_test.go index 279e7fa79c..502900187f 100644 --- a/cli/command/trust/common_test.go +++ b/cli/command/trust/common_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/cli/trust" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestMatchReleasedSignaturesSortOrder(t *testing.T) { diff --git a/cli/command/trust/formatter_test.go b/cli/command/trust/formatter_test.go index 300f6c8c20..403e72a7ee 100644 --- a/cli/command/trust/formatter_test.go +++ b/cli/command/trust/formatter_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/docker/pkg/stringid" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestTrustTag(t *testing.T) { diff --git a/cli/command/trust/helpers_test.go b/cli/command/trust/helpers_test.go index fab61214c4..32c247b6fe 100644 --- a/cli/command/trust/helpers_test.go +++ b/cli/command/trust/helpers_test.go @@ -8,7 +8,7 @@ import ( "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustpinning" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestGetOrGenerateNotaryKeyAndInitRepo(t *testing.T) { diff --git a/cli/command/trust/inspect_pretty_test.go b/cli/command/trust/inspect_pretty_test.go index d9ed38306a..8afcb4c7e2 100644 --- a/cli/command/trust/inspect_pretty_test.go +++ b/cli/command/trust/inspect_pretty_test.go @@ -17,9 +17,9 @@ import ( "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" "github.com/theupdateframework/notary/tuf/utils" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) // TODO(n4ss): remove common tests with the regular inspect command diff --git a/cli/command/trust/inspect_test.go b/cli/command/trust/inspect_test.go index 4ab89b65de..0700952d67 100644 --- a/cli/command/trust/inspect_test.go +++ b/cli/command/trust/inspect_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/notary" "github.com/theupdateframework/notary/client" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestTrustInspectCommandErrors(t *testing.T) { diff --git a/cli/command/trust/key_generate_test.go b/cli/command/trust/key_generate_test.go index b4c798d87d..aa61f3e793 100644 --- a/cli/command/trust/key_generate_test.go +++ b/cli/command/trust/key_generate_test.go @@ -14,8 +14,8 @@ import ( "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustmanager" tufutils "github.com/theupdateframework/notary/tuf/utils" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestTrustKeyGenerateErrors(t *testing.T) { diff --git a/cli/command/trust/key_load_test.go b/cli/command/trust/key_load_test.go index b8c89f1cd5..d0fd466c3f 100644 --- a/cli/command/trust/key_load_test.go +++ b/cli/command/trust/key_load_test.go @@ -16,9 +16,9 @@ import ( "github.com/theupdateframework/notary/storage" "github.com/theupdateframework/notary/trustmanager" tufutils "github.com/theupdateframework/notary/tuf/utils" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/skip" ) func TestTrustKeyLoadErrors(t *testing.T) { diff --git a/cli/command/trust/revoke_test.go b/cli/command/trust/revoke_test.go index 8c4073999a..f0182c248b 100644 --- a/cli/command/trust/revoke_test.go +++ b/cli/command/trust/revoke_test.go @@ -11,8 +11,8 @@ import ( "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustpinning" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestTrustRevokeCommandErrors(t *testing.T) { diff --git a/cli/command/trust/sign_test.go b/cli/command/trust/sign_test.go index f197c7f599..38d7d63610 100644 --- a/cli/command/trust/sign_test.go +++ b/cli/command/trust/sign_test.go @@ -18,9 +18,9 @@ import ( "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustpinning" "github.com/theupdateframework/notary/tuf/data" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/skip" ) const passwd = "password" diff --git a/cli/command/trust/signer_add_test.go b/cli/command/trust/signer_add_test.go index 64121e2958..f7a3dbd198 100644 --- a/cli/command/trust/signer_add_test.go +++ b/cli/command/trust/signer_add_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/cli/internal/test" notaryfake "github.com/docker/cli/internal/test/notary" "github.com/theupdateframework/notary" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestTrustSignerAddErrors(t *testing.T) { diff --git a/cli/command/trust/signer_remove_test.go b/cli/command/trust/signer_remove_test.go index 0feec87430..1a529fe78a 100644 --- a/cli/command/trust/signer_remove_test.go +++ b/cli/command/trust/signer_remove_test.go @@ -8,8 +8,8 @@ import ( notaryfake "github.com/docker/cli/internal/test/notary" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestTrustSignerRemoveErrors(t *testing.T) { diff --git a/cli/command/utils_test.go b/cli/command/utils_test.go index a4257200e1..566b932841 100644 --- a/cli/command/utils_test.go +++ b/cli/command/utils_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestStringSliceReplaceAt(t *testing.T) { diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index a0646ed113..7fab40e4a1 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types" volumetypes "github.com/docker/docker/api/types/volume" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestVolumeCreateErrors(t *testing.T) { diff --git a/cli/command/volume/inspect_test.go b/cli/command/volume/inspect_test.go index c5baa9c62e..2dfce9102c 100644 --- a/cli/command/volume/inspect_test.go +++ b/cli/command/volume/inspect_test.go @@ -9,8 +9,8 @@ import ( . "github.com/docker/cli/internal/test/builders" // Import builders to get the builder function as package function "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestVolumeInspectErrors(t *testing.T) { diff --git a/cli/command/volume/list_test.go b/cli/command/volume/list_test.go index 9f07006f16..6f61291bf8 100644 --- a/cli/command/volume/list_test.go +++ b/cli/command/volume/list_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/docker/api/types/filters" volumetypes "github.com/docker/docker/api/types/volume" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" ) func TestVolumeListErrors(t *testing.T) { diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index 800eaa730f..0c9d51fe51 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -12,9 +12,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/golden" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" + "gotest.tools/v3/skip" ) func TestVolumePruneErrors(t *testing.T) { diff --git a/cli/command/volume/remove_test.go b/cli/command/volume/remove_test.go index 789d906a87..2f7769d3a3 100644 --- a/cli/command/volume/remove_test.go +++ b/cli/command/volume/remove_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestVolumeRemoveErrors(t *testing.T) { diff --git a/cli/compose/convert/compose_test.go b/cli/compose/convert/compose_test.go index 98b2dc1cc5..0dfac14e15 100644 --- a/cli/compose/convert/compose_test.go +++ b/cli/compose/convert/compose_test.go @@ -6,9 +6,9 @@ import ( composetypes "github.com/docker/cli/cli/compose/types" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" ) func TestNamespaceScope(t *testing.T) { diff --git a/cli/compose/convert/service_test.go b/cli/compose/convert/service_test.go index 85550628f2..8419bdbf65 100644 --- a/cli/compose/convert/service_test.go +++ b/cli/compose/convert/service_test.go @@ -14,8 +14,8 @@ import ( "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestConvertRestartPolicyFromNone(t *testing.T) { diff --git a/cli/compose/convert/volume_test.go b/cli/compose/convert/volume_test.go index 5f5bd8aaab..2b08357bd3 100644 --- a/cli/compose/convert/volume_test.go +++ b/cli/compose/convert/volume_test.go @@ -5,8 +5,8 @@ import ( composetypes "github.com/docker/cli/cli/compose/types" "github.com/docker/docker/api/types/mount" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestConvertVolumeToMountAnonymousVolume(t *testing.T) { diff --git a/cli/compose/interpolation/interpolation_test.go b/cli/compose/interpolation/interpolation_test.go index 3e76642a91..55800b1b26 100644 --- a/cli/compose/interpolation/interpolation_test.go +++ b/cli/compose/interpolation/interpolation_test.go @@ -5,9 +5,9 @@ import ( "strconv" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/env" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/env" ) var defaults = map[string]string{ diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 09c98fa93c..db57dba24a 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/cli/cli/compose/types" "github.com/google/go-cmp/cmp/cmpopts" "github.com/sirupsen/logrus" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func buildConfigDetails(source map[string]interface{}, env map[string]string) types.ConfigDetails { diff --git a/cli/compose/loader/merge_test.go b/cli/compose/loader/merge_test.go index 178d302da2..6b94fce4be 100644 --- a/cli/compose/loader/merge_test.go +++ b/cli/compose/loader/merge_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/docker/cli/cli/compose/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestLoadTwoDifferentVersion(t *testing.T) { diff --git a/cli/compose/loader/types_test.go b/cli/compose/loader/types_test.go index 32a92db3f8..e69becdcbf 100644 --- a/cli/compose/loader/types_test.go +++ b/cli/compose/loader/types_test.go @@ -5,8 +5,8 @@ import ( "testing" yaml "gopkg.in/yaml.v2" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestMarshallConfig(t *testing.T) { diff --git a/cli/compose/loader/volume_test.go b/cli/compose/loader/volume_test.go index ebe5f6b596..7be0411db9 100644 --- a/cli/compose/loader/volume_test.go +++ b/cli/compose/loader/volume_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/docker/cli/cli/compose/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestParseVolumeAnonymousVolume(t *testing.T) { diff --git a/cli/compose/schema/schema_test.go b/cli/compose/schema/schema_test.go index 3133400c49..bf759b3e4d 100644 --- a/cli/compose/schema/schema_test.go +++ b/cli/compose/schema/schema_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) type dict map[string]interface{} diff --git a/cli/compose/template/template_test.go b/cli/compose/template/template_test.go index b1610009bb..e8b3a5aae3 100644 --- a/cli/compose/template/template_test.go +++ b/cli/compose/template/template_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) var defaults = map[string]string{ diff --git a/cli/config/config_test.go b/cli/config/config_test.go index 4ca981e6ce..bf41d6328f 100644 --- a/cli/config/config_test.go +++ b/cli/config/config_test.go @@ -14,8 +14,8 @@ import ( "github.com/docker/cli/cli/config/credentials" "github.com/docker/docker/pkg/homedir" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func setupConfigDir(t *testing.T) (string, func()) { diff --git a/cli/config/configfile/file_test.go b/cli/config/configfile/file_test.go index 83574bf85c..ab20602f0d 100644 --- a/cli/config/configfile/file_test.go +++ b/cli/config/configfile/file_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/cli/config/credentials" "github.com/docker/cli/cli/config/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" ) func TestEncodeAuth(t *testing.T) { diff --git a/cli/config/credentials/file_store_test.go b/cli/config/credentials/file_store_test.go index df7fc8b04c..3a95f2be20 100644 --- a/cli/config/credentials/file_store_test.go +++ b/cli/config/credentials/file_store_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/docker/cli/cli/config/types" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) type fakeStore struct { diff --git a/cli/config/credentials/native_store_test.go b/cli/config/credentials/native_store_test.go index 4d6340bc11..7c54a967be 100644 --- a/cli/config/credentials/native_store_test.go +++ b/cli/config/credentials/native_store_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker-credential-helpers/client" "github.com/docker/docker-credential-helpers/credentials" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) const ( diff --git a/cli/connhelper/commandconn/commandconn_unix_test.go b/cli/connhelper/commandconn/commandconn_unix_test.go index 764c647359..18231b8f2a 100644 --- a/cli/connhelper/commandconn/commandconn_unix_test.go +++ b/cli/connhelper/commandconn/commandconn_unix_test.go @@ -7,8 +7,8 @@ import ( "io" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) // For https://github.com/docker/cli/pull/1014#issuecomment-409308139 diff --git a/cli/connhelper/ssh/ssh_test.go b/cli/connhelper/ssh/ssh_test.go index 60478fc0af..1bbfd49634 100644 --- a/cli/connhelper/ssh/ssh_test.go +++ b/cli/connhelper/ssh/ssh_test.go @@ -3,8 +3,8 @@ package ssh import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestParseURL(t *testing.T) { diff --git a/cli/context/kubernetes/endpoint_test.go b/cli/context/kubernetes/endpoint_test.go index d5cfe437c3..4d352874be 100644 --- a/cli/context/kubernetes/endpoint_test.go +++ b/cli/context/kubernetes/endpoint_test.go @@ -7,7 +7,7 @@ import ( "github.com/docker/cli/cli/context" "github.com/docker/cli/cli/context/store" - "gotest.tools/assert" + "gotest.tools/v3/assert" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) diff --git a/cli/context/kubernetes/load_test.go b/cli/context/kubernetes/load_test.go index 203f5dbb9a..a35276fcc4 100644 --- a/cli/context/kubernetes/load_test.go +++ b/cli/context/kubernetes/load_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/config/configfile" cliflags "github.com/docker/cli/cli/flags" - "gotest.tools/assert" - "gotest.tools/env" + "gotest.tools/v3/assert" + "gotest.tools/v3/env" ) func TestDefaultContextInitializer(t *testing.T) { diff --git a/cli/context/store/io_utils_test.go b/cli/context/store/io_utils_test.go index 3840ae5f90..e7b6ecf975 100644 --- a/cli/context/store/io_utils_test.go +++ b/cli/context/store/io_utils_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestLimitReaderReadAll(t *testing.T) { diff --git a/cli/context/store/metadata_test.go b/cli/context/store/metadata_test.go index ec17f28ccf..3d9a5be5f1 100644 --- a/cli/context/store/metadata_test.go +++ b/cli/context/store/metadata_test.go @@ -6,8 +6,8 @@ import ( "path/filepath" "testing" - "gotest.tools/assert" - "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" ) func testMetadata(name string) Metadata { diff --git a/cli/context/store/store_test.go b/cli/context/store/store_test.go index d1d92b250c..df506061e5 100644 --- a/cli/context/store/store_test.go +++ b/cli/context/store/store_test.go @@ -13,7 +13,7 @@ import ( "path" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) type endpoint struct { diff --git a/cli/context/store/storeconfig_test.go b/cli/context/store/storeconfig_test.go index 8cc5c79070..7f59e3f015 100644 --- a/cli/context/store/storeconfig_test.go +++ b/cli/context/store/storeconfig_test.go @@ -3,7 +3,7 @@ package store import ( "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) type testCtx struct{} diff --git a/cli/context/store/tlsstore_test.go b/cli/context/store/tlsstore_test.go index e8d029606e..a8a735dcf7 100644 --- a/cli/context/store/tlsstore_test.go +++ b/cli/context/store/tlsstore_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestTlsCreateUpdateGetRemove(t *testing.T) { diff --git a/cli/flags/common_test.go b/cli/flags/common_test.go index 7150691ecc..07edb41223 100644 --- a/cli/flags/common_test.go +++ b/cli/flags/common_test.go @@ -6,8 +6,8 @@ import ( cliconfig "github.com/docker/cli/cli/config" "github.com/spf13/pflag" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestCommonOptionsInstallFlags(t *testing.T) { diff --git a/cli/manifest/store/store_test.go b/cli/manifest/store/store_test.go index aa06afd35c..a89f3980ba 100644 --- a/cli/manifest/store/store_test.go +++ b/cli/manifest/store/store_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/cli/manifest/types" "github.com/docker/distribution/reference" "github.com/google/go-cmp/cmp" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) type fakeRef struct { diff --git a/cli/required_test.go b/cli/required_test.go index df3e9a467a..f13d26c969 100644 --- a/cli/required_test.go +++ b/cli/required_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/spf13/cobra" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestRequiresNoArgs(t *testing.T) { diff --git a/cli/trust/trust_test.go b/cli/trust/trust_test.go index b49b7ca878..c49f41008f 100644 --- a/cli/trust/trust_test.go +++ b/cli/trust/trust_test.go @@ -10,8 +10,8 @@ import ( "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/passphrase" "github.com/theupdateframework/notary/trustpinning" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestGetTag(t *testing.T) { diff --git a/cmd/docker/docker_test.go b/cmd/docker/docker_test.go index 044daa12d3..388eb2af85 100644 --- a/cmd/docker/docker_test.go +++ b/cmd/docker/docker_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/debug" "github.com/sirupsen/logrus" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestClientDebugEnabled(t *testing.T) { diff --git a/e2e/cli-plugins/config_test.go b/e2e/cli-plugins/config_test.go index e99ffc6bb4..a9d55e3d87 100644 --- a/e2e/cli-plugins/config_test.go +++ b/e2e/cli-plugins/config_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/docker/cli/cli/config" - "gotest.tools/assert" - "gotest.tools/icmd" + "gotest.tools/v3/assert" + "gotest.tools/v3/icmd" ) func TestConfig(t *testing.T) { diff --git a/e2e/cli-plugins/dial_test.go b/e2e/cli-plugins/dial_test.go index 4072cef0eb..0be5ec3d4c 100644 --- a/e2e/cli-plugins/dial_test.go +++ b/e2e/cli-plugins/dial_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/docker/cli/cli-plugins/manager" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/icmd" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/icmd" ) func TestCLIPluginDialStdio(t *testing.T) { diff --git a/e2e/cli-plugins/flags_test.go b/e2e/cli-plugins/flags_test.go index 34c3ac3281..f1565da8eb 100644 --- a/e2e/cli-plugins/flags_test.go +++ b/e2e/cli-plugins/flags_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "gotest.tools/icmd" + "gotest.tools/v3/icmd" ) // TestRunGoodArgument ensures correct behaviour when running a valid plugin with an `--argument`. diff --git a/e2e/cli-plugins/help_test.go b/e2e/cli-plugins/help_test.go index b73054d4a3..e8fcf1cfe8 100644 --- a/e2e/cli-plugins/help_test.go +++ b/e2e/cli-plugins/help_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/icmd" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/icmd" ) // TestGlobalHelp ensures correct behaviour when running `docker help` diff --git a/e2e/cli-plugins/run_test.go b/e2e/cli-plugins/run_test.go index 91d384645e..3042044f22 100644 --- a/e2e/cli-plugins/run_test.go +++ b/e2e/cli-plugins/run_test.go @@ -3,10 +3,10 @@ package cliplugins import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" - "gotest.tools/icmd" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" ) const shortHFlagDeprecated = "Flag shorthand -h has been deprecated, please use --help\n" diff --git a/e2e/cli-plugins/util_test.go b/e2e/cli-plugins/util_test.go index dca0bd8f18..73819598ba 100644 --- a/e2e/cli-plugins/util_test.go +++ b/e2e/cli-plugins/util_test.go @@ -7,9 +7,9 @@ import ( "github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config/configfile" - "gotest.tools/assert" - "gotest.tools/fs" - "gotest.tools/icmd" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" ) func prepare(t *testing.T) (func(args ...string) icmd.Cmd, *configfile.ConfigFile, func()) { diff --git a/e2e/container/attach_test.go b/e2e/container/attach_test.go index 3be6c2ae14..68517b3613 100644 --- a/e2e/container/attach_test.go +++ b/e2e/container/attach_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/cli/e2e/internal/fixtures" - "gotest.tools/icmd" + "gotest.tools/v3/icmd" ) func TestAttachExitCode(t *testing.T) { diff --git a/e2e/container/create_test.go b/e2e/container/create_test.go index 38e632a290..3c519df12e 100644 --- a/e2e/container/create_test.go +++ b/e2e/container/create_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) func TestCreateWithContentTrust(t *testing.T) { diff --git a/e2e/container/kill_test.go b/e2e/container/kill_test.go index d4e71591af..2f3a35784f 100644 --- a/e2e/container/kill_test.go +++ b/e2e/container/kill_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/docker/cli/e2e/internal/fixtures" - "gotest.tools/icmd" - "gotest.tools/poll" + "gotest.tools/v3/icmd" + "gotest.tools/v3/poll" ) func TestKillContainer(t *testing.T) { diff --git a/e2e/container/proxy_signal_test.go b/e2e/container/proxy_signal_test.go index 7d769b7180..c88a94416b 100644 --- a/e2e/container/proxy_signal_test.go +++ b/e2e/container/proxy_signal_test.go @@ -9,9 +9,9 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/kr/pty" - "gotest.tools/assert" - "gotest.tools/icmd" - "gotest.tools/poll" + "gotest.tools/v3/assert" + "gotest.tools/v3/icmd" + "gotest.tools/v3/poll" ) // TestSigProxyWithTTY tests that killing the docker CLI forwards the signal to diff --git a/e2e/container/run_test.go b/e2e/container/run_test.go index 68a3e40027..cb30e916b7 100644 --- a/e2e/container/run_test.go +++ b/e2e/container/run_test.go @@ -6,11 +6,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const registryPrefix = "registry:5000" diff --git a/e2e/context/context_test.go b/e2e/context/context_test.go index b427217116..ce22f7b7c3 100644 --- a/e2e/context/context_test.go +++ b/e2e/context/context_test.go @@ -3,8 +3,8 @@ package context import ( "testing" - "gotest.tools/golden" - "gotest.tools/icmd" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" ) func TestContextList(t *testing.T) { diff --git a/e2e/image/build_test.go b/e2e/image/build_test.go index af62915059..120fa37f2e 100644 --- a/e2e/image/build_test.go +++ b/e2e/image/build_test.go @@ -10,11 +10,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" "github.com/docker/cli/internal/test/output" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) func TestBuildFromContextDirectoryWithTag(t *testing.T) { diff --git a/e2e/image/pull_test.go b/e2e/image/pull_test.go index 2d06a51c18..0d12fe68fa 100644 --- a/e2e/image/pull_test.go +++ b/e2e/image/pull_test.go @@ -5,11 +5,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/golden" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const registryPrefix = "registry:5000" diff --git a/e2e/image/push_test.go b/e2e/image/push_test.go index 1bcf025556..495a312688 100644 --- a/e2e/image/push_test.go +++ b/e2e/image/push_test.go @@ -10,11 +10,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" "github.com/docker/cli/internal/test/output" - "gotest.tools/assert" - "gotest.tools/fs" - "gotest.tools/golden" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const ( diff --git a/e2e/internal/fixtures/fixtures.go b/e2e/internal/fixtures/fixtures.go index a06cf53db6..8ba7de8012 100644 --- a/e2e/internal/fixtures/fixtures.go +++ b/e2e/internal/fixtures/fixtures.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "gotest.tools/fs" - "gotest.tools/icmd" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" ) const ( diff --git a/e2e/plugin/trust_test.go b/e2e/plugin/trust_test.go index 36a602de8e..393de03651 100644 --- a/e2e/plugin/trust_test.go +++ b/e2e/plugin/trust_test.go @@ -12,10 +12,10 @@ import ( "github.com/docker/cli/internal/test/environment" "github.com/docker/docker/api/types" "github.com/pkg/errors" - "gotest.tools/assert" - "gotest.tools/fs" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const registryPrefix = "registry:5000" diff --git a/e2e/stack/deploy_test.go b/e2e/stack/deploy_test.go index 959405c68d..2b797aeab5 100644 --- a/e2e/stack/deploy_test.go +++ b/e2e/stack/deploy_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/docker/cli/internal/test/environment" - "gotest.tools/assert" - "gotest.tools/golden" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) func TestDeployWithNamedResources(t *testing.T) { diff --git a/e2e/stack/help_test.go b/e2e/stack/help_test.go index e356fcae16..e7f55c0cc0 100644 --- a/e2e/stack/help_test.go +++ b/e2e/stack/help_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "gotest.tools/golden" - "gotest.tools/icmd" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" ) func TestStackDeployHelp(t *testing.T) { diff --git a/e2e/stack/remove_test.go b/e2e/stack/remove_test.go index 16be892e23..f6222000d6 100644 --- a/e2e/stack/remove_test.go +++ b/e2e/stack/remove_test.go @@ -6,10 +6,10 @@ import ( "testing" "github.com/docker/cli/internal/test/environment" - "gotest.tools/golden" - "gotest.tools/icmd" - "gotest.tools/poll" - "gotest.tools/skip" + "gotest.tools/v3/golden" + "gotest.tools/v3/icmd" + "gotest.tools/v3/poll" + "gotest.tools/v3/skip" ) var pollSettings = environment.DefaultPollSettings diff --git a/e2e/system/inspect_test.go b/e2e/system/inspect_test.go index 2b32959721..77fee31151 100644 --- a/e2e/system/inspect_test.go +++ b/e2e/system/inspect_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "gotest.tools/icmd" + "gotest.tools/v3/icmd" ) // TestInspectInvalidReference migrated from moby/integration-cli diff --git a/e2e/trust/revoke_test.go b/e2e/trust/revoke_test.go index 85b1cdc0e1..fe0f44de04 100644 --- a/e2e/trust/revoke_test.go +++ b/e2e/trust/revoke_test.go @@ -6,11 +6,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const ( diff --git a/e2e/trust/sign_test.go b/e2e/trust/sign_test.go index da054530e0..9f953b4adb 100644 --- a/e2e/trust/sign_test.go +++ b/e2e/trust/sign_test.go @@ -6,11 +6,11 @@ import ( "github.com/docker/cli/e2e/internal/fixtures" "github.com/docker/cli/internal/test/environment" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" - "gotest.tools/fs" - "gotest.tools/icmd" - "gotest.tools/skip" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/fs" + "gotest.tools/v3/icmd" + "gotest.tools/v3/skip" ) const ( diff --git a/internal/containerizedengine/containerd_test.go b/internal/containerizedengine/containerd_test.go index 0a724a4924..75193b93db 100644 --- a/internal/containerizedengine/containerd_test.go +++ b/internal/containerizedengine/containerd_test.go @@ -9,7 +9,7 @@ import ( "github.com/containerd/containerd" "github.com/docker/cli/cli/streams" "github.com/docker/docker/api/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestPullWithAuthPullFail(t *testing.T) { diff --git a/internal/containerizedengine/update_test.go b/internal/containerizedengine/update_test.go index 24b51d9f53..387e3422d2 100644 --- a/internal/containerizedengine/update_test.go +++ b/internal/containerizedengine/update_test.go @@ -16,7 +16,7 @@ import ( clitypes "github.com/docker/cli/types" "github.com/docker/docker/api/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestActivateImagePermutations(t *testing.T) { diff --git a/internal/licenseutils/utils_test.go b/internal/licenseutils/utils_test.go index 68b67239fe..3cab0290f5 100644 --- a/internal/licenseutils/utils_test.go +++ b/internal/licenseutils/utils_test.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/licensing/model" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestLoginNoAuth(t *testing.T) { diff --git a/internal/pkg/containerized/hostpaths_test.go b/internal/pkg/containerized/hostpaths_test.go index c0fd1d7dd8..3432b2e4ba 100644 --- a/internal/pkg/containerized/hostpaths_test.go +++ b/internal/pkg/containerized/hostpaths_test.go @@ -6,7 +6,7 @@ import ( "github.com/containerd/containerd/containers" specs "github.com/opencontainers/runtime-spec/specs-go" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestWithAllCapabilities(t *testing.T) { diff --git a/internal/test/environment/testenv.go b/internal/test/environment/testenv.go index a6e16814fa..5dbe70656a 100644 --- a/internal/test/environment/testenv.go +++ b/internal/test/environment/testenv.go @@ -7,9 +7,9 @@ import ( "time" "github.com/pkg/errors" - "gotest.tools/icmd" - "gotest.tools/poll" - "gotest.tools/skip" + "gotest.tools/v3/icmd" + "gotest.tools/v3/poll" + "gotest.tools/v3/skip" ) // Setup a new environment diff --git a/internal/test/strings.go b/internal/test/strings.go index c0c952e6a5..d001c8f3f8 100644 --- a/internal/test/strings.go +++ b/internal/test/strings.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) // CompareMultipleValues compares comma-separated values, whatever the order is diff --git a/internal/versions/versions_test.go b/internal/versions/versions_test.go index 3469d8bbc3..fdb6b46d79 100644 --- a/internal/versions/versions_test.go +++ b/internal/versions/versions_test.go @@ -7,7 +7,7 @@ import ( "testing" clitypes "github.com/docker/cli/types" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestParseTagsSimple(t *testing.T) { diff --git a/kubernetes/check_test.go b/kubernetes/check_test.go index 28a9029f06..ec1ac6d36e 100644 --- a/kubernetes/check_test.go +++ b/kubernetes/check_test.go @@ -3,8 +3,8 @@ package kubernetes import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/opts/duration_test.go b/opts/duration_test.go index 1a2c76a8d3..6b4bf42149 100644 --- a/opts/duration_test.go +++ b/opts/duration_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestDurationOptString(t *testing.T) { diff --git a/opts/gpus_test.go b/opts/gpus_test.go index 23fe7992e3..8f620046df 100644 --- a/opts/gpus_test.go +++ b/opts/gpus_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/docker/docker/api/types/container" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestGpusOptAll(t *testing.T) { diff --git a/opts/mount_test.go b/opts/mount_test.go index e59f07fe62..1da6319070 100644 --- a/opts/mount_test.go +++ b/opts/mount_test.go @@ -5,8 +5,8 @@ import ( "testing" mounttypes "github.com/docker/docker/api/types/mount" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestMountOptString(t *testing.T) { diff --git a/opts/network_test.go b/opts/network_test.go index 0d38955dc5..ea6c915ef0 100644 --- a/opts/network_test.go +++ b/opts/network_test.go @@ -3,8 +3,8 @@ package opts import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestNetworkOptLegacySyntax(t *testing.T) { diff --git a/opts/opts_test.go b/opts/opts_test.go index 9c9f9689ff..a1be7b5147 100644 --- a/opts/opts_test.go +++ b/opts/opts_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func TestValidateIPAddress(t *testing.T) { diff --git a/opts/port_test.go b/opts/port_test.go index 1f6b994dfc..e364c52b10 100644 --- a/opts/port_test.go +++ b/opts/port_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/docker/docker/api/types/swarm" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestPortOptValidSimpleSyntax(t *testing.T) { diff --git a/opts/quotedstring_test.go b/opts/quotedstring_test.go index 72ec6a21cb..95b56f2b83 100644 --- a/opts/quotedstring_test.go +++ b/opts/quotedstring_test.go @@ -3,8 +3,8 @@ package opts import ( "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestQuotedStringSetWithQuotes(t *testing.T) { diff --git a/opts/secret_test.go b/opts/secret_test.go index 94dd80d19a..d5134fb387 100644 --- a/opts/secret_test.go +++ b/opts/secret_test.go @@ -4,8 +4,8 @@ import ( "os" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestSecretOptionsSimple(t *testing.T) { diff --git a/service/logs/parse_logs_test.go b/service/logs/parse_logs_test.go index 4a423b9eb8..0a7ad3d967 100644 --- a/service/logs/parse_logs_test.go +++ b/service/logs/parse_logs_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/pkg/errors" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestParseLogDetails(t *testing.T) { diff --git a/templates/templates_test.go b/templates/templates_test.go index 3a007e7b9a..de71ef610c 100644 --- a/templates/templates_test.go +++ b/templates/templates_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "gotest.tools/assert" - is "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) // GitHub #32120 diff --git a/vendor.conf b/vendor.conf index 0f15cab968..19ae43b5b0 100755 --- a/vendor.conf +++ b/vendor.conf @@ -90,7 +90,7 @@ google.golang.org/genproto 02b4e95473316948020af0b7a4f0 google.golang.org/grpc 39e8a7b072a67ca2a75f57fa2e0d50995f5b22f6 # v1.23.1 gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1 gopkg.in/yaml.v2 bb4e33bf68bf89cad44d386192cbed201f35b241 # v2.2.3 -gotest.tools 1083505acf35a0bd8a696b26837e1fb3187a7a83 # v2.3.0 +gotest.tools/v3 ab4a870b92ce57a83881fbeb535a137a20d664b7 # v3.0.1 k8s.io/api 40a48860b5abbba9aa891b02b32da429b08d96a0 # kubernetes-1.14.0 k8s.io/apimachinery d7deff9243b165ee192f5551710ea4285dcfd615 # kubernetes-1.14.0 k8s.io/client-go 6ee68ca5fd8355d024d02f9db0b3b667e8357a0f # kubernetes-1.14.0 diff --git a/vendor/gotest.tools/go.mod b/vendor/gotest.tools/go.mod deleted file mode 100644 index 39d0a1a779..0000000000 --- a/vendor/gotest.tools/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module gotest.tools - -require ( - github.com/google/go-cmp v0.2.0 - github.com/pkg/errors v0.8.0 - github.com/spf13/pflag v1.0.3 - golang.org/x/tools v0.0.0-20180810170437-e96c4e24768d -) diff --git a/vendor/gotest.tools/LICENSE b/vendor/gotest.tools/v3/LICENSE similarity index 100% rename from vendor/gotest.tools/LICENSE rename to vendor/gotest.tools/v3/LICENSE diff --git a/vendor/gotest.tools/README.md b/vendor/gotest.tools/v3/README.md similarity index 68% rename from vendor/gotest.tools/README.md rename to vendor/gotest.tools/v3/README.md index 3155723dd7..56b3e4ad20 100644 --- a/vendor/gotest.tools/README.md +++ b/vendor/gotest.tools/v3/README.md @@ -2,26 +2,41 @@ A collection of packages to augment `testing` and support common patterns. -[![GoDoc](https://godoc.org/gotest.tools?status.svg)](https://godoc.org/gotest.tools) +[![GoDoc](https://godoc.org/gotest.tools?status.svg)](http://gotest.tools) [![CircleCI](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master.svg?style=shield)](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master) [![Go Reportcard](https://goreportcard.com/badge/gotest.tools)](https://goreportcard.com/report/gotest.tools) +## Usage + +With Go modules enabled (go1.11+) + +``` +$ go get gotest.tools/v3 +``` + +``` +import "gotest.tools/v3/assert" +``` + +To use `gotest.tools` with an older version of Go that does not understand Go +module paths pin to version `v2.3.0`. + ## Packages -* [assert](http://godoc.org/gotest.tools/assert) - +* [assert](http://gotest.tools/assert) - compare values and fail the test when a comparison fails -* [env](http://godoc.org/gotest.tools/env) - +* [env](http://gotest.tools/env) - test code which uses environment variables -* [fs](http://godoc.org/gotest.tools/fs) - +* [fs](http://gotest.tools/fs) - create temporary files and compare a filesystem tree to an expected value -* [golden](http://godoc.org/gotest.tools/golden) - +* [golden](http://gotest.tools/golden) - compare large multi-line strings against values frozen in golden files -* [icmd](http://godoc.org/gotest.tools/icmd) - +* [icmd](http://gotest.tools/icmd) - execute binaries and test the output -* [poll](http://godoc.org/gotest.tools/poll) - +* [poll](http://gotest.tools/poll) - test asynchronous code by polling until a desired state is reached -* [skip](http://godoc.org/gotest.tools/skip) - +* [skip](http://gotest.tools/skip) - skip a test and print the source code of the condition used to skip the test ## Related diff --git a/vendor/gotest.tools/assert/assert.go b/vendor/gotest.tools/v3/assert/assert.go similarity index 81% rename from vendor/gotest.tools/assert/assert.go rename to vendor/gotest.tools/v3/assert/assert.go index 05d6635436..83610aa852 100644 --- a/vendor/gotest.tools/assert/assert.go +++ b/vendor/gotest.tools/v3/assert/assert.go @@ -49,30 +49,31 @@ The example below shows assert used with some common types. Comparisons -Package https://godoc.org/gotest.tools/assert/cmp provides +Package http://gotest.tools/assert/cmp provides many common comparisons. Additional comparisons can be written to compare values in other ways. See the example Assert (CustomComparison). Automated migration from testify -gty-migrate-from-testify is a binary which can update source code which uses -testify assertions to use the assertions provided by this package. +gty-migrate-from-testify is a command which translates Go source code from +testify assertions to the assertions provided by this package. -See http://bit.do/cmd-gty-migrate-from-testify. +See http://gotest.tools/assert/cmd/gty-migrate-from-testify. */ -package assert // import "gotest.tools/assert" +package assert // import "gotest.tools/v3/assert" import ( "fmt" "go/ast" "go/token" + "reflect" gocmp "github.com/google/go-cmp/cmp" - "gotest.tools/assert/cmp" - "gotest.tools/internal/format" - "gotest.tools/internal/source" + "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/internal/format" + "gotest.tools/v3/internal/source" ) // BoolOrComparison can be a bool, or cmp.Comparison. See Assert() for usage. @@ -118,6 +119,10 @@ func assert( return true case error: + // Handle nil structs which implement error as a nil error + if reflect.ValueOf(check).IsNil() { + return true + } msg := "error is not nil: " t.Log(format.WithCustomMessage(failureMessage+msg+check.Error(), msgAndArgs...)) @@ -202,17 +207,20 @@ func boolFailureMessage(expr ast.Expr) (string, error) { return "expression is false: " + formatted, nil } -// Assert performs a comparison. If the comparison fails the test is marked as +// Assert performs a comparison. If the comparison fails, the test is marked as // failed, a failure message is logged, and execution is stopped immediately. // -// The comparison argument may be one of three types: bool, cmp.Comparison or -// error. -// When called with a bool the failure message will contain the literal source -// code of the expression. -// When called with a cmp.Comparison the comparison is responsible for producing -// a helpful failure message. -// When called with an error a nil value is considered success. A non-nil error -// is a failure, and Error() is used as the failure message. +// The comparison argument may be one of three types: +// bool +// True is success. False is a failure. +// The failure message will contain the literal source code of the expression. +// cmp.Comparison +// Uses cmp.Result.Success() to check for success of failure. +// The comparison is responsible for producing a helpful failure message. +// http://gotest.tools/assert/cmp provides many common comparisons. +// error +// A nil value is considered success. +// A non-nil error is a failure, err.Error() is used as the failure message. func Assert(t TestingT, comparison BoolOrComparison, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() @@ -260,10 +268,10 @@ func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) { assert(t, t.FailNow, argsAfterT, cmp.Equal(x, y), msgAndArgs...) } -// DeepEqual uses google/go-cmp (http://bit.do/go-cmp) to assert two values are -// equal and fails the test if they are not equal. +// DeepEqual uses google/go-cmp (https://godoc.org/github.com/google/go-cmp/cmp) +// to assert two values are equal and fails the test if they are not equal. // -// Package https://godoc.org/gotest.tools/assert/opt provides some additional +// Package http://gotest.tools/assert/opt provides some additional // commonly used Options. // // This is equivalent to Assert(t, cmp.DeepEqual(x, y)). @@ -295,14 +303,19 @@ func ErrorContains(t TestingT, err error, substring string, msgAndArgs ...interf } // ErrorType fails the test if err is nil, or err is not the expected type. +// Equivalent to Assert(t, cmp.ErrorType(err, expected)). // // Expected can be one of: -// a func(error) bool which returns true if the error is the expected type, -// an instance of (or a pointer to) a struct of the expected type, -// a pointer to an interface the error is expected to implement, -// a reflect.Type of the expected struct or interface. -// -// Equivalent to Assert(t, cmp.ErrorType(err, expected)). +// func(error) bool +// Function should return true if the error is the expected type. +// type struct{}, type &struct{} +// A struct or a pointer to a struct. +// Fails if the error is not of the same type as expected. +// type &interface{} +// A pointer to an interface type. +// Fails if err does not implement the interface. +// reflect.Type +// Fails if err does not implement the reflect.Type func ErrorType(t TestingT, err error, expected interface{}, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() diff --git a/vendor/gotest.tools/assert/cmp/compare.go b/vendor/gotest.tools/v3/assert/cmp/compare.go similarity index 92% rename from vendor/gotest.tools/assert/cmp/compare.go rename to vendor/gotest.tools/v3/assert/cmp/compare.go index cf48d887ac..bb3b24f437 100644 --- a/vendor/gotest.tools/assert/cmp/compare.go +++ b/vendor/gotest.tools/v3/assert/cmp/compare.go @@ -1,5 +1,5 @@ /*Package cmp provides Comparisons for Assert and Check*/ -package cmp // import "gotest.tools/assert/cmp" +package cmp // import "gotest.tools/v3/assert/cmp" import ( "fmt" @@ -8,7 +8,7 @@ import ( "strings" "github.com/google/go-cmp/cmp" - "gotest.tools/internal/format" + "gotest.tools/v3/internal/format" ) // Comparison is a function which compares values and returns ResultSuccess if @@ -16,11 +16,12 @@ import ( // Result will contain a message about why it failed. type Comparison func() Result -// DeepEqual compares two values using google/go-cmp (http://bit.do/go-cmp) +// DeepEqual compares two values using google/go-cmp +// (https://godoc.org/github.com/google/go-cmp/cmp) // and succeeds if the values are equal. // // The comparison can be customized using comparison Options. -// Package https://godoc.org/gotest.tools/assert/opt provides some additional +// Package http://gotest.tools/assert/opt provides some additional // commonly used Options. func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison { return func() (result Result) { @@ -103,10 +104,10 @@ func Equal(x, y interface{}) Comparison { return multiLineDiffResult(diff) } return ResultFailureTemplate(` - {{- .Data.x}} ( + {{- printf "%v" .Data.x}} ( {{- with callArg 0 }}{{ formatNode . }} {{end -}} {{- printf "%T" .Data.x -}} - ) != {{ .Data.y}} ( + ) != {{ printf "%v" .Data.y}} ( {{- with callArg 1 }}{{ formatNode . }} {{end -}} {{- printf "%T" .Data.y -}} )`, @@ -241,10 +242,12 @@ func ErrorContains(err error, substring string) Comparison { } } +type causer interface { + Cause() error +} + func formatErrorMessage(err error) string { - if _, ok := err.(interface { - Cause() error - }); ok { + if _, ok := err.(causer); ok { return fmt.Sprintf("%q\n%+v", err, err) } // This error was not wrapped with github.com/pkg/errors @@ -283,10 +286,16 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison { // ErrorType succeeds if err is not nil and is of the expected type. // // Expected can be one of: -// a func(error) bool which returns true if the error is the expected type, -// an instance of (or a pointer to) a struct of the expected type, -// a pointer to an interface the error is expected to implement, -// a reflect.Type of the expected struct or interface. +// func(error) bool +// Function should return true if the error is the expected type. +// type struct{}, type &struct{} +// A struct or a pointer to a struct. +// Fails if the error is not of the same type as expected. +// type &interface{} +// A pointer to an interface type. +// Fails if err does not implement the interface. +// reflect.Type +// Fails if err does not implement the reflect.Type func ErrorType(err error, expected interface{}) Comparison { return func() Result { switch expectedType := expected.(type) { diff --git a/vendor/gotest.tools/assert/cmp/result.go b/vendor/gotest.tools/v3/assert/cmp/result.go similarity index 98% rename from vendor/gotest.tools/assert/cmp/result.go rename to vendor/gotest.tools/v3/assert/cmp/result.go index 204edda4bc..385e1a0873 100644 --- a/vendor/gotest.tools/assert/cmp/result.go +++ b/vendor/gotest.tools/v3/assert/cmp/result.go @@ -6,7 +6,7 @@ import ( "go/ast" "text/template" - "gotest.tools/internal/source" + "gotest.tools/v3/internal/source" ) // A Result of a Comparison. diff --git a/vendor/gotest.tools/assert/result.go b/vendor/gotest.tools/v3/assert/result.go similarity index 95% rename from vendor/gotest.tools/assert/result.go rename to vendor/gotest.tools/v3/assert/result.go index 949d939619..d77860b588 100644 --- a/vendor/gotest.tools/assert/result.go +++ b/vendor/gotest.tools/v3/assert/result.go @@ -4,9 +4,9 @@ import ( "fmt" "go/ast" - "gotest.tools/assert/cmp" - "gotest.tools/internal/format" - "gotest.tools/internal/source" + "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/internal/format" + "gotest.tools/v3/internal/source" ) func runComparison( diff --git a/vendor/gotest.tools/env/env.go b/vendor/gotest.tools/v3/env/env.go similarity index 73% rename from vendor/gotest.tools/env/env.go rename to vendor/gotest.tools/v3/env/env.go index 609d90e996..7a71acd0d7 100644 --- a/vendor/gotest.tools/env/env.go +++ b/vendor/gotest.tools/v3/env/env.go @@ -1,14 +1,14 @@ /*Package env provides functions to test code that read environment variables or the current working directory. */ -package env // import "gotest.tools/env" +package env // import "gotest.tools/v3/env" import ( "os" "strings" - "gotest.tools/assert" - "gotest.tools/x/subtest" + "gotest.tools/v3/assert" + "gotest.tools/v3/internal/cleanup" ) type helperT interface { @@ -18,30 +18,34 @@ type helperT interface { // Patch changes the value of an environment variable, and returns a // function which will reset the the value of that variable back to the // previous state. +// +// When used with Go 1.14+ the unpatch function will be called automatically +// when the test ends, unless the TEST_NOCLEANUP env var is set to true. func Patch(t assert.TestingT, key, value string) func() { if ht, ok := t.(helperT); ok { ht.Helper() } - oldValue, ok := os.LookupEnv(key) + oldValue, envVarExists := os.LookupEnv(key) assert.NilError(t, os.Setenv(key, value)) - cleanup := func() { + clean := func() { if ht, ok := t.(helperT); ok { ht.Helper() } - if !ok { + if !envVarExists { assert.NilError(t, os.Unsetenv(key)) return } assert.NilError(t, os.Setenv(key, oldValue)) } - if tc, ok := t.(subtest.TestContext); ok { - tc.AddCleanup(cleanup) - } - return cleanup + cleanup.Cleanup(t, clean) + return clean } // PatchAll sets the environment to env, and returns a function which will // reset the environment back to the previous state. +// +// When used with Go 1.14+ the unpatch function will be called automatically +// when the test ends, unless the TEST_NOCLEANUP env var is set to true. func PatchAll(t assert.TestingT, env map[string]string) func() { if ht, ok := t.(helperT); ok { ht.Helper() @@ -52,7 +56,7 @@ func PatchAll(t assert.TestingT, env map[string]string) func() { for key, value := range env { assert.NilError(t, os.Setenv(key, value), "setenv %s=%s", key, value) } - cleanup := func() { + clean := func() { if ht, ok := t.(helperT); ok { ht.Helper() } @@ -61,10 +65,8 @@ func PatchAll(t assert.TestingT, env map[string]string) func() { assert.NilError(t, os.Setenv(key, oldVal), "setenv %s=%s", key, oldVal) } } - if tc, ok := t.(subtest.TestContext); ok { - tc.AddCleanup(cleanup) - } - return cleanup + cleanup.Cleanup(t, clean) + return clean } // ToMap takes a list of strings in the format returned by os.Environ() and @@ -94,6 +96,10 @@ func getParts(raw string) (string, string) { // ChangeWorkingDir to the directory, and return a function which restores the // previous working directory. +// +// When used with Go 1.14+ the previous working directory will be restored +// automatically when the test ends, unless the TEST_NOCLEANUP env var is set to +// true. func ChangeWorkingDir(t assert.TestingT, dir string) func() { if ht, ok := t.(helperT); ok { ht.Helper() @@ -101,14 +107,12 @@ func ChangeWorkingDir(t assert.TestingT, dir string) func() { cwd, err := os.Getwd() assert.NilError(t, err) assert.NilError(t, os.Chdir(dir)) - cleanup := func() { + clean := func() { if ht, ok := t.(helperT); ok { ht.Helper() } assert.NilError(t, os.Chdir(cwd)) } - if tc, ok := t.(subtest.TestContext); ok { - tc.AddCleanup(cleanup) - } - return cleanup + cleanup.Cleanup(t, clean) + return clean } diff --git a/vendor/gotest.tools/fs/file.go b/vendor/gotest.tools/v3/fs/file.go similarity index 83% rename from vendor/gotest.tools/fs/file.go rename to vendor/gotest.tools/v3/fs/file.go index 7d0cab363b..de5f4ec120 100644 --- a/vendor/gotest.tools/fs/file.go +++ b/vendor/gotest.tools/v3/fs/file.go @@ -1,7 +1,7 @@ /*Package fs provides tools for creating temporary files, and testing the contents and structure of a directory. */ -package fs // import "gotest.tools/fs" +package fs // import "gotest.tools/v3/fs" import ( "io/ioutil" @@ -10,8 +10,8 @@ import ( "runtime" "strings" - "gotest.tools/assert" - "gotest.tools/x/subtest" + "gotest.tools/v3/assert" + "gotest.tools/v3/internal/cleanup" ) // Path objects return their filesystem path. Path may be implemented by a @@ -38,18 +38,21 @@ type helperT interface { // NewFile creates a new file in a temporary directory using prefix as part of // the filename. The PathOps are applied to the before returning the File. +// +// When used with Go 1.14+ the file will be automatically removed when the test +// ends, unless the TEST_NOCLEANUP env var is set to true. func NewFile(t assert.TestingT, prefix string, ops ...PathOp) *File { if ht, ok := t.(helperT); ok { ht.Helper() } tempfile, err := ioutil.TempFile("", cleanPrefix(prefix)+"-") assert.NilError(t, err) + file := &File{path: tempfile.Name()} + cleanup.Cleanup(t, file.Remove) + assert.NilError(t, tempfile.Close()) assert.NilError(t, applyPathOps(file, ops)) - if tc, ok := t.(subtest.TestContext); ok { - tc.AddCleanup(file.Remove) - } return file } @@ -79,6 +82,9 @@ type Dir struct { // NewDir returns a new temporary directory using prefix as part of the directory // name. The PathOps are applied before returning the Dir. +// +// When used with Go 1.14+ the directory will be automatically removed when the test +// ends, unless the TEST_NOCLEANUP env var is set to true. func NewDir(t assert.TestingT, prefix string, ops ...PathOp) *Dir { if ht, ok := t.(helperT); ok { ht.Helper() @@ -86,10 +92,9 @@ func NewDir(t assert.TestingT, prefix string, ops ...PathOp) *Dir { path, err := ioutil.TempDir("", cleanPrefix(prefix)+"-") assert.NilError(t, err) dir := &Dir{path: path} + cleanup.Cleanup(t, dir.Remove) + assert.NilError(t, applyPathOps(dir, ops)) - if tc, ok := t.(subtest.TestContext); ok { - tc.AddCleanup(dir.Remove) - } return dir } diff --git a/vendor/gotest.tools/fs/manifest.go b/vendor/gotest.tools/v3/fs/manifest.go similarity index 99% rename from vendor/gotest.tools/fs/manifest.go rename to vendor/gotest.tools/v3/fs/manifest.go index e5e693e6c5..d396756376 100644 --- a/vendor/gotest.tools/fs/manifest.go +++ b/vendor/gotest.tools/v3/fs/manifest.go @@ -7,7 +7,7 @@ import ( "path/filepath" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) // Manifest stores the expected structure and properties of files and directories diff --git a/vendor/gotest.tools/fs/manifest_unix.go b/vendor/gotest.tools/v3/fs/manifest_unix.go similarity index 100% rename from vendor/gotest.tools/fs/manifest_unix.go rename to vendor/gotest.tools/v3/fs/manifest_unix.go diff --git a/vendor/gotest.tools/fs/manifest_windows.go b/vendor/gotest.tools/v3/fs/manifest_windows.go similarity index 100% rename from vendor/gotest.tools/fs/manifest_windows.go rename to vendor/gotest.tools/v3/fs/manifest_windows.go diff --git a/vendor/gotest.tools/fs/ops.go b/vendor/gotest.tools/v3/fs/ops.go similarity index 94% rename from vendor/gotest.tools/fs/ops.go rename to vendor/gotest.tools/v3/fs/ops.go index c3c33587b6..4589623fa9 100644 --- a/vendor/gotest.tools/fs/ops.go +++ b/vendor/gotest.tools/v3/fs/ops.go @@ -10,7 +10,7 @@ import ( "time" "github.com/pkg/errors" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) const defaultFileMode = 0644 @@ -61,6 +61,23 @@ func WithBytes(raw []byte) PathOp { } } +// WithReaderContent copies the reader contents to the file at Path +func WithReaderContent(r io.Reader) PathOp { + return func(path Path) error { + if m, ok := path.(manifestFile); ok { + m.SetContent(ioutil.NopCloser(r)) + return nil + } + f, err := os.OpenFile(path.Path(), os.O_WRONLY, defaultFileMode) + if err != nil { + return err + } + defer f.Close() + _, err = io.Copy(f, r) + return err + } +} + // AsUser changes ownership of the file system object at Path func AsUser(uid, gid int) PathOp { return func(path Path) error { diff --git a/vendor/gotest.tools/fs/path.go b/vendor/gotest.tools/v3/fs/path.go similarity index 98% rename from vendor/gotest.tools/fs/path.go rename to vendor/gotest.tools/v3/fs/path.go index 4bb38774bc..c301b90489 100644 --- a/vendor/gotest.tools/fs/path.go +++ b/vendor/gotest.tools/v3/fs/path.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "os" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) // resourcePath is an adaptor for resources so they can be used as a Path @@ -150,7 +150,7 @@ const anyFile = "*" // to contain unspecified files. func MatchExtraFiles(path Path) error { if m, ok := path.(*directoryPath); ok { - m.AddFile(anyFile) + return m.AddFile(anyFile) } return nil } @@ -180,7 +180,7 @@ func MatchFileContent(f func([]byte) CompareResult) PathOp { func MatchFilesWithGlob(glob string, ops ...PathOp) PathOp { return func(path Path) error { if m, ok := path.(*directoryPath); ok { - m.AddGlobFiles(glob, ops...) + return m.AddGlobFiles(glob, ops...) } return nil } diff --git a/vendor/gotest.tools/fs/report.go b/vendor/gotest.tools/v3/fs/report.go similarity index 97% rename from vendor/gotest.tools/fs/report.go rename to vendor/gotest.tools/v3/fs/report.go index adc5a5f1bc..0b2d73d977 100644 --- a/vendor/gotest.tools/fs/report.go +++ b/vendor/gotest.tools/v3/fs/report.go @@ -10,8 +10,8 @@ import ( "sort" "strings" - "gotest.tools/assert/cmp" - "gotest.tools/internal/format" + "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/internal/format" ) // Equal compares a directory to the expected structured described by a manifest @@ -159,7 +159,7 @@ func eqSymlink(x, y *symlink) []problem { func eqDirectory(path string, x, y *directory) []failure { p := eqResource(x.resource, y.resource) - var f []failure + var f []failure // nolint: prealloc matchedFiles := make(map[string]bool) for _, name := range sortedKeys(x.items) { @@ -209,7 +209,7 @@ func maybeAppendFailure(failures []failure, path string, problems []problem) []f } func sortedKeys(items map[string]dirEntry) []string { - var keys []string + keys := make([]string, 0, len(items)) for key := range items { keys = append(keys, key) } diff --git a/vendor/gotest.tools/v3/go.mod b/vendor/gotest.tools/v3/go.mod new file mode 100644 index 0000000000..4ae9354e50 --- /dev/null +++ b/vendor/gotest.tools/v3/go.mod @@ -0,0 +1,10 @@ +module gotest.tools/v3 + +require ( + github.com/google/go-cmp v0.3.0 + github.com/pkg/errors v0.8.1 + github.com/spf13/pflag v1.0.3 + golang.org/x/tools v0.0.0-20190624222133-a101b041ded4 +) + +go 1.11 diff --git a/vendor/gotest.tools/golden/golden.go b/vendor/gotest.tools/v3/golden/golden.go similarity index 67% rename from vendor/gotest.tools/golden/golden.go rename to vendor/gotest.tools/v3/golden/golden.go index 7264529900..d585db64dd 100644 --- a/vendor/gotest.tools/golden/golden.go +++ b/vendor/gotest.tools/v3/golden/golden.go @@ -1,19 +1,23 @@ /*Package golden provides tools for comparing large mutli-line strings. Golden files are files in the ./testdata/ subdirectory of the package under test. +Golden files can be automatically updated to match new values by running +`go test pkgname -test.update-golden`. To ensure the update is correct +compare the diff of the old expected value to the new expected value. */ -package golden // import "gotest.tools/golden" +package golden // import "gotest.tools/v3/golden" import ( "bytes" "flag" "fmt" "io/ioutil" + "os" "path/filepath" - "gotest.tools/assert" - "gotest.tools/assert/cmp" - "gotest.tools/internal/format" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" + "gotest.tools/v3/internal/format" ) var flagUpdate = flag.Bool("test.update-golden", false, "update golden file") @@ -22,6 +26,16 @@ type helperT interface { Helper() } +// Open opens the file in ./testdata +func Open(t assert.TestingT, filename string) *os.File { + if ht, ok := t.(helperT); ok { + ht.Helper() + } + f, err := os.Open(Path(filename)) + assert.NilError(t, err) + return f +} + // Get returns the contents of the file in ./testdata func Get(t assert.TestingT, filename string) []byte { if ht, ok := t.(helperT); ok { @@ -57,11 +71,12 @@ func exactBytes(in []byte) []byte { return in } -// Assert compares the actual content to the expected content in the golden file. -// If the `-test.update-golden` flag is set then the actual content is written +// Assert compares actual to the expected value in the golden file. +// +// Running `go test pkgname -test.update-golden` will write the value of actual // to the golden file. -// Returns whether the assertion was successful (true) or not (false). -// This is equivalent to assert.Check(t, String(actual, filename)) +// +// This is equivalent to assert.Assert(t, String(actual, filename)) func Assert(t assert.TestingT, actual string, filename string, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() @@ -71,7 +86,8 @@ func Assert(t assert.TestingT, actual string, filename string, msgAndArgs ...int // String compares actual to the contents of filename and returns success // if the strings are equal. -// If the `-test.update-golden` flag is set then the actual content is written +// +// Running `go test pkgname -test.update-golden` will write the value of actual // to the golden file. // // Any \r\n substrings in actual are converted to a single \n character @@ -91,15 +107,23 @@ func String(actual string, filename string) cmp.Comparison { From: "expected", To: "actual", }) - return cmp.ResultFailure("\n" + diff) + return cmp.ResultFailure("\n" + diff + failurePostamble(filename)) } } -// AssertBytes compares the actual result to the expected result in the golden -// file. If the `-test.update-golden` flag is set then the actual content is -// written to the golden file. -// Returns whether the assertion was successful (true) or not (false). -// This is equivalent to assert.Check(t, Bytes(actual, filename)) +func failurePostamble(filename string) string { + return fmt.Sprintf(` + +You can run 'go test . -test.update-golden' to automatically update %s to the new expected value.' +`, Path(filename)) +} + +// AssertBytes compares actual to the expected value in the golden. +// +// Running `go test pkgname -test.update-golden` will write the value of actual +// to the golden file. +// +// This is equivalent to assert.Assert(t, Bytes(actual, filename)) func AssertBytes( t assert.TestingT, actual []byte, @@ -114,7 +138,8 @@ func AssertBytes( // Bytes compares actual to the contents of filename and returns success // if the bytes are equal. -// If the `-test.update-golden` flag is set then the actual content is written +// +// Running `go test pkgname -test.update-golden` will write the value of actual // to the golden file. func Bytes(actual []byte, filename string) cmp.Comparison { return func() cmp.Result { @@ -123,7 +148,7 @@ func Bytes(actual []byte, filename string) cmp.Comparison { return result } msg := fmt.Sprintf("%v (actual) != %v (expected)", actual, expected) - return cmp.ResultFailure(msg) + return cmp.ResultFailure(msg + failurePostamble(filename)) } } diff --git a/vendor/gotest.tools/icmd/command.go b/vendor/gotest.tools/v3/icmd/command.go similarity index 95% rename from vendor/gotest.tools/icmd/command.go rename to vendor/gotest.tools/v3/icmd/command.go index e931ccb928..3f0c64893a 100644 --- a/vendor/gotest.tools/icmd/command.go +++ b/vendor/gotest.tools/v3/icmd/command.go @@ -1,18 +1,19 @@ /*Package icmd executes binaries and provides convenient assertions for testing the results. */ -package icmd // import "gotest.tools/icmd" +package icmd // import "gotest.tools/v3/icmd" import ( "bytes" "fmt" "io" + "os" "os/exec" "strings" "sync" "time" - "gotest.tools/assert" - "gotest.tools/assert/cmp" + "gotest.tools/v3/assert" + "gotest.tools/v3/assert/cmp" ) type helperT interface { @@ -191,12 +192,13 @@ func (r *Result) setExitError(err error) { // Cmd contains the arguments and options for a process to run as part of a test // suite. type Cmd struct { - Command []string - Timeout time.Duration - Stdin io.Reader - Stdout io.Writer - Dir string - Env []string + Command []string + Timeout time.Duration + Stdin io.Reader + Stdout io.Writer + Dir string + Env []string + ExtraFiles []*os.File } // Command create a simple Cmd with the specified command and arguments @@ -252,6 +254,8 @@ func buildCmd(cmd Cmd) *Result { execCmd.Stdout = outBuffer } execCmd.Stderr = errBuffer + execCmd.ExtraFiles = cmd.ExtraFiles + return &Result{ Cmd: execCmd, outBuffer: outBuffer, diff --git a/vendor/gotest.tools/icmd/exitcode.go b/vendor/gotest.tools/v3/icmd/exitcode.go similarity index 100% rename from vendor/gotest.tools/icmd/exitcode.go rename to vendor/gotest.tools/v3/icmd/exitcode.go diff --git a/vendor/gotest.tools/icmd/ops.go b/vendor/gotest.tools/v3/icmd/ops.go similarity index 81% rename from vendor/gotest.tools/icmd/ops.go rename to vendor/gotest.tools/v3/icmd/ops.go index 18176eead3..35c3958d52 100644 --- a/vendor/gotest.tools/icmd/ops.go +++ b/vendor/gotest.tools/v3/icmd/ops.go @@ -2,6 +2,7 @@ package icmd import ( "io" + "os" "time" ) @@ -36,3 +37,10 @@ func WithStdin(r io.Reader) CmdOp { c.Stdin = r } } + +// WithExtraFile adds a file descriptor to the command +func WithExtraFile(f *os.File) CmdOp { + return func(c *Cmd) { + c.ExtraFiles = append(c.ExtraFiles, f) + } +} diff --git a/vendor/gotest.tools/v3/internal/cleanup/cleanup.go b/vendor/gotest.tools/v3/internal/cleanup/cleanup.go new file mode 100644 index 0000000000..7e2922f409 --- /dev/null +++ b/vendor/gotest.tools/v3/internal/cleanup/cleanup.go @@ -0,0 +1,45 @@ +/*Package cleanup handles migration to and support for the Go 1.14+ +testing.TB.Cleanup() function. +*/ +package cleanup + +import ( + "os" + "strings" + + "gotest.tools/v3/x/subtest" +) + +type cleanupT interface { + Cleanup(f func()) +} + +type logT interface { + Log(...interface{}) +} + +type helperT interface { + Helper() +} + +var noCleanup = strings.ToLower(os.Getenv("TEST_NOCLEANUP")) == "true" + +// Cleanup registers f as a cleanup function on t if any mechanisms are available. +// +// Skips registering f if TEST_NOCLEANUP is set to true. +func Cleanup(t logT, f func()) { + if ht, ok := t.(helperT); ok { + ht.Helper() + } + if noCleanup { + t.Log("skipping cleanup because TEST_NOCLEANUP was enabled.") + return + } + if ct, ok := t.(cleanupT); ok { + ct.Cleanup(f) + return + } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(f) + } +} diff --git a/vendor/gotest.tools/internal/difflib/LICENSE b/vendor/gotest.tools/v3/internal/difflib/LICENSE similarity index 100% rename from vendor/gotest.tools/internal/difflib/LICENSE rename to vendor/gotest.tools/v3/internal/difflib/LICENSE diff --git a/vendor/gotest.tools/internal/difflib/difflib.go b/vendor/gotest.tools/v3/internal/difflib/difflib.go similarity index 99% rename from vendor/gotest.tools/internal/difflib/difflib.go rename to vendor/gotest.tools/v3/internal/difflib/difflib.go index b6f486b9c9..9bf506b6be 100644 --- a/vendor/gotest.tools/internal/difflib/difflib.go +++ b/vendor/gotest.tools/v3/internal/difflib/difflib.go @@ -4,7 +4,7 @@ Original source: https://github.com/pmezard/go-difflib This file is trimmed to only the parts used by this repository. */ -package difflib // import "gotest.tools/internal/difflib" +package difflib // import "gotest.tools/v3/internal/difflib" func min(a, b int) int { if a < b { diff --git a/vendor/gotest.tools/internal/format/diff.go b/vendor/gotest.tools/v3/internal/format/diff.go similarity index 99% rename from vendor/gotest.tools/internal/format/diff.go rename to vendor/gotest.tools/v3/internal/format/diff.go index c938c97bec..9897d4b9d9 100644 --- a/vendor/gotest.tools/internal/format/diff.go +++ b/vendor/gotest.tools/v3/internal/format/diff.go @@ -6,7 +6,7 @@ import ( "strings" "unicode" - "gotest.tools/internal/difflib" + "gotest.tools/v3/internal/difflib" ) const ( diff --git a/vendor/gotest.tools/internal/format/format.go b/vendor/gotest.tools/v3/internal/format/format.go similarity index 91% rename from vendor/gotest.tools/internal/format/format.go rename to vendor/gotest.tools/v3/internal/format/format.go index 8f6494f994..5097e4bd6e 100644 --- a/vendor/gotest.tools/internal/format/format.go +++ b/vendor/gotest.tools/v3/internal/format/format.go @@ -1,4 +1,4 @@ -package format // import "gotest.tools/internal/format" +package format // import "gotest.tools/v3/internal/format" import "fmt" diff --git a/vendor/gotest.tools/internal/source/defers.go b/vendor/gotest.tools/v3/internal/source/defers.go similarity index 100% rename from vendor/gotest.tools/internal/source/defers.go rename to vendor/gotest.tools/v3/internal/source/defers.go diff --git a/vendor/gotest.tools/internal/source/source.go b/vendor/gotest.tools/v3/internal/source/source.go similarity index 91% rename from vendor/gotest.tools/internal/source/source.go rename to vendor/gotest.tools/v3/internal/source/source.go index 8a5d0e8d35..134afb6bac 100644 --- a/vendor/gotest.tools/internal/source/source.go +++ b/vendor/gotest.tools/v3/internal/source/source.go @@ -1,4 +1,4 @@ -package source // import "gotest.tools/internal/source" +package source // import "gotest.tools/v3/internal/source" import ( "bytes" @@ -92,7 +92,9 @@ func nodePosition(fileset *token.FileSet, node ast.Node) token.Position { return fileset.Position(node.Pos()) } -var goVersionBefore19 = func() bool { +// GoVersionLessThan returns true if runtime.Version() is semantically less than +// version 1.minor. +func GoVersionLessThan(minor int64) bool { version := runtime.Version() // not a release version if !strings.HasPrefix(version, "go") { @@ -103,9 +105,11 @@ var goVersionBefore19 = func() bool { if len(parts) < 2 { return false } - minor, err := strconv.ParseInt(parts[1], 10, 32) - return err == nil && parts[0] == "1" && minor < 9 -}() + actual, err := strconv.ParseInt(parts[1], 10, 32) + return err == nil && parts[0] == "1" && actual < minor +} + +var goVersionBefore19 = GoVersionLessThan(9) func getCallExprArgs(node ast.Node) ([]ast.Expr, error) { visitor := &callExprVisitor{} diff --git a/vendor/gotest.tools/poll/check.go b/vendor/gotest.tools/v3/poll/check.go similarity index 100% rename from vendor/gotest.tools/poll/check.go rename to vendor/gotest.tools/v3/poll/check.go diff --git a/vendor/gotest.tools/poll/poll.go b/vendor/gotest.tools/v3/poll/poll.go similarity index 98% rename from vendor/gotest.tools/poll/poll.go rename to vendor/gotest.tools/v3/poll/poll.go index 5e238dca42..b5bd7108c2 100644 --- a/vendor/gotest.tools/poll/poll.go +++ b/vendor/gotest.tools/v3/poll/poll.go @@ -1,6 +1,6 @@ /*Package poll provides tools for testing asynchronous code. */ -package poll // import "gotest.tools/poll" +package poll // import "gotest.tools/v3/poll" import ( "fmt" diff --git a/vendor/gotest.tools/skip/skip.go b/vendor/gotest.tools/v3/skip/skip.go similarity index 95% rename from vendor/gotest.tools/skip/skip.go rename to vendor/gotest.tools/v3/skip/skip.go index d27ca53c3d..cb899f78b1 100644 --- a/vendor/gotest.tools/skip/skip.go +++ b/vendor/gotest.tools/v3/skip/skip.go @@ -1,7 +1,7 @@ /*Package skip provides functions for skipping a test and printing the source code of the condition used to skip the test. */ -package skip // import "gotest.tools/skip" +package skip // import "gotest.tools/v3/skip" import ( "fmt" @@ -10,8 +10,8 @@ import ( "runtime" "strings" - "gotest.tools/internal/format" - "gotest.tools/internal/source" + "gotest.tools/v3/internal/format" + "gotest.tools/v3/internal/source" ) type skipT interface { diff --git a/vendor/gotest.tools/x/subtest/context.go b/vendor/gotest.tools/v3/x/subtest/context.go similarity index 85% rename from vendor/gotest.tools/x/subtest/context.go rename to vendor/gotest.tools/v3/x/subtest/context.go index 878bdebf14..5750bf409f 100644 --- a/vendor/gotest.tools/x/subtest/context.go +++ b/vendor/gotest.tools/v3/x/subtest/context.go @@ -3,7 +3,7 @@ provides a testing.TB, and context.Context. This package was inspired by github.com/frankban/quicktest. */ -package subtest // import "gotest.tools/x/subtest" +package subtest // import "gotest.tools/v3/x/subtest" import ( "context" @@ -27,9 +27,9 @@ func (tc *testcase) Ctx() context.Context { return tc.ctx } -// Cleanup runs all cleanup functions. Functions are run in the opposite order +// cleanup runs all cleanup functions. Functions are run in the opposite order // in which they were added. Cleanup is called automatically before Run exits. -func (tc *testcase) Cleanup() { +func (tc *testcase) cleanup() { for _, f := range tc.cleanupFuncs { // Defer all cleanup functions so they all run even if one calls // t.FailNow() or panics. Deferring them also runs them in reverse order. @@ -59,7 +59,7 @@ type parallel interface { func Run(t *testing.T, name string, subtest func(t TestContext)) bool { return t.Run(name, func(t *testing.T) { tc := &testcase{TB: t} - defer tc.Cleanup() + defer tc.cleanup() subtest(tc) }) } @@ -68,6 +68,9 @@ func Run(t *testing.T, name string, subtest func(t TestContext)) bool { type TestContext interface { testing.TB // AddCleanup function which will be run when before Run returns. + // + // Deprecated: Go 1.14+ now includes a testing.TB.Cleanup(func()) which + // should be used instead. AddCleanup will be removed in a future release. AddCleanup(f func()) // Ctx returns a context for the test case. Multiple calls from the same subtest // will return the same context. The context is cancelled when Run