From be8041423b4e6610d3eae1af7d4bdc222785ed69 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 12 Sep 2026 01:18:01 +0900 Subject: [PATCH 1/5] switch to go module Rename vendor.mod/vendor.sum to go.mod/go.sum, making this repository a proper Go module. This removes the machinery that was needed to work around the absence of a go.mod: - scripts/with-go-mod.sh, which symlinked vendor.mod/vendor.sum into place for commands that require a module; - the equivalent symlink dances in the CodeQL and test workflows, and in Dockerfile.lint; - the "GO111MODULE=auto" overrides in the Makefile, build scripts, and Dockerfiles; - internal/gocompat, which verified that our packages are consumable in module mode. With a real go.mod, the "go" directive sets the language version for all packages in the module, so the "//go:build go1.xx" workaround it guarded is no longer needed. Signed-off-by: CrazyMax Assisted-by: Claude Opus 5 Signed-off-by: Akihiro Suda --- .dockerignore | 4 - .gitattributes | 2 - .github/workflows/codeql.yml | 10 - .github/workflows/test.yml | 3 - .github/workflows/validate.yml | 25 - .gitignore | 4 - Dockerfile | 1 - Makefile | 17 +- dockerfiles/Dockerfile.dev | 1 - dockerfiles/Dockerfile.lint | 4 - dockerfiles/Dockerfile.vendor | 8 +- vendor.mod => go.mod | 10 +- vendor.sum => go.sum | 2 - internal/gocompat/.gitignore | 4 - internal/gocompat/Makefile | 14 - internal/gocompat/generate.go | 3 - internal/gocompat/modulegenerator.go | 199 -- scripts/build/binary | 2 - scripts/build/plugins | 2 +- scripts/build/trust-plugin | 2 +- scripts/docs/generate-man.sh | 2 +- scripts/test/e2e/run | 1 - scripts/vendor | 4 +- scripts/with-go-mod.sh | 41 - vendor/golang.org/x/mod/LICENSE | 27 - vendor/golang.org/x/mod/PATENTS | 22 - .../x/mod/internal/lazyregexp/lazyre.go | 78 - vendor/golang.org/x/mod/modfile/print.go | 184 -- vendor/golang.org/x/mod/modfile/read.go | 962 -------- vendor/golang.org/x/mod/modfile/rule.go | 1951 ----------------- vendor/golang.org/x/mod/modfile/work.go | 333 --- vendor/golang.org/x/mod/module/module.go | 840 ------- vendor/golang.org/x/mod/module/pseudo.go | 250 --- vendor/golang.org/x/mod/semver/semver.go | 407 ---- vendor/modules.txt | 6 - 35 files changed, 16 insertions(+), 5409 deletions(-) rename vendor.mod => go.mod (91%) rename vendor.sum => go.sum (99%) delete mode 100644 internal/gocompat/.gitignore delete mode 100644 internal/gocompat/Makefile delete mode 100644 internal/gocompat/generate.go delete mode 100644 internal/gocompat/modulegenerator.go delete mode 100755 scripts/with-go-mod.sh delete mode 100644 vendor/golang.org/x/mod/LICENSE delete mode 100644 vendor/golang.org/x/mod/PATENTS delete mode 100644 vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go delete mode 100644 vendor/golang.org/x/mod/modfile/print.go delete mode 100644 vendor/golang.org/x/mod/modfile/read.go delete mode 100644 vendor/golang.org/x/mod/modfile/rule.go delete mode 100644 vendor/golang.org/x/mod/modfile/work.go delete mode 100644 vendor/golang.org/x/mod/module/module.go delete mode 100644 vendor/golang.org/x/mod/module/pseudo.go delete mode 100644 vendor/golang.org/x/mod/semver/semver.go diff --git a/.dockerignore b/.dockerignore index 905ef55cd6f5..fd9affb8e32b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,3 @@ /docs/vendor/ /docs/go.sum profile.out - -# top-level go.mod is not meant to be checked in -/go.mod -/go.sum diff --git a/.gitattributes b/.gitattributes index 5152817b1284..eff188819879 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,6 @@ * text=auto Dockerfile* linguist-language=Dockerfile -vendor.mod linguist-language=Go-Module -vendor.sum linguist-language=Go-Checksums *.go -text diff=golang diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ead4a4f0f270..c565f7806b26 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,16 +50,6 @@ jobs: with: fetch-depth: 2 persist-credentials: false - # CodeQL 2.16.4's auto-build added support for multi-module repositories, - # and is trying to be smart by searching for modules in every directory, - # including vendor directories. If no module is found, it's creating one - # which is ... not what we want, so let's give it a "go.mod". - # see: https://github.com/docker/cli/pull/4944#issuecomment-2002034698 - - - name: Create go.mod - run: | - ln -s vendor.mod go.mod - ln -s vendor.sum go.sum - name: Update Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b6a5ea56447..f34497ee7051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,9 +73,6 @@ jobs: - name: Test run: | - # run in go modules mode to prevent traversing to nested modules - ln -s vendor.mod go.mod - ln -s vendor.sum go.sum go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/e2e/') go tool cover -func=/tmp/coverage.txt working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1396c8d7b0aa..4c3a55f776d7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -84,28 +84,3 @@ jobs: shell: 'script --return --quiet --command "bash {0}"' run: | make -f docker.Makefile ${{ matrix.target }} - - validate-gocompat: - runs-on: ubuntu-26.04 - env: - GOPATH: ${{ github.workspace }} - GO111MODULE: off - steps: - - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: src/github.com/docker/cli - persist-credentials: false - - - name: Set up Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version: "1.26.9" - cache: false - - - name: Run gocompat check - shell: 'script --return --quiet --command "bash {0}"' - working-directory: ${{ github.workspace }}/src/github.com/docker/cli - run: | - make -C ./internal/gocompat verify diff --git a/.gitignore b/.gitignore index a9c2d9d3ab2c..c83c667207dc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,3 @@ Thumbs.db /cmd/docker/winresources/versioninfo.json /cmd/docker/winresources/*.syso profile.out - -# top-level go.mod is not meant to be checked in -/go.mod -/go.sum diff --git a/Dockerfile b/Dockerfile index 59f519dcbed1..28110ce5adce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,7 +93,6 @@ RUN --mount=type=bind,target=.,ro \ FROM build-${BASE_VARIANT} AS test COPY --link --from=gotestsum /out/gotestsum /usr/bin/gotestsum -ENV GO111MODULE=auto RUN --mount=type=bind,target=.,rw \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod \ diff --git a/Makefile b/Makefile index 93c080ee4bb0..00461f489be9 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,6 @@ # Sets the name of the company that produced the windows binary. PACKAGER_NAME ?= -# The repository doesn't have a go.mod, but "go list", and "gotestsum" -# expect to be run from a module. -GO111MODULE=auto -export GO111MODULE - all: binary _:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS)) @@ -81,15 +76,15 @@ install-trust-plugin: ## install docker-trust CLI plugins .PHONY: vendor vendor: ## update vendor with go modules rm -rf vendor - scripts/with-go-mod.sh scripts/vendor update + scripts/vendor update .PHONY: validate-vendor validate-vendor: ## validate vendor - scripts/with-go-mod.sh scripts/vendor validate + scripts/vendor validate .PHONY: mod-outdated mod-outdated: ## check outdated dependencies - scripts/with-go-mod.sh scripts/vendor outdated + scripts/vendor outdated .PHONY: authors authors: ## generate AUTHORS file from git history @@ -124,15 +119,15 @@ shell-completion: ## generate shell-completion scripts .PHONY: manpages manpages: ## generate man pages from go source and markdown - scripts/with-go-mod.sh scripts/docs/generate-man.sh + scripts/docs/generate-man.sh .PHONY: mddocs mddocs: ## generate markdown files from go source - scripts/with-go-mod.sh scripts/docs/generate-md.sh + scripts/docs/generate-md.sh .PHONY: yamldocs yamldocs: ## generate documentation YAML files consumed by docs repo - scripts/with-go-mod.sh scripts/docs/generate-yaml.sh + scripts/docs/generate-yaml.sh .PHONY: help help: ## print this help diff --git a/dockerfiles/Dockerfile.dev b/dockerfiles/Dockerfile.dev index c1a7d04c27cc..5e74cc11866b 100644 --- a/dockerfiles/Dockerfile.dev +++ b/dockerfiles/Dockerfile.dev @@ -88,5 +88,4 @@ COPY --link --from=gotestsum /go/bin/* /go/bin/ COPY --link --from=goversioninfo /go/bin/* /go/bin/ WORKDIR /go/src/github.com/docker/cli -ENV GO111MODULE=auto COPY --link . . diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index e6acf6f71863..4a0e854a2b36 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -13,14 +13,10 @@ FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS lint ENV GOTOOLCHAIN=local -ENV GO111MODULE=auto ENV CGO_ENABLED=0 ENV GOGC=75 WORKDIR /go/src/github.com/docker/cli COPY --link --from=golangci-lint /usr/bin/golangci-lint /usr/bin/golangci-lint RUN --mount=type=bind,target=.,rw \ --mount=type=cache,target=/root/.cache \ - rm -f go.mod go.sum && \ - ln -s vendor.mod go.mod && \ - ln -s vendor.sum go.sum && \ golangci-lint run diff --git a/dockerfiles/Dockerfile.vendor b/dockerfiles/Dockerfile.vendor index 442e88286e1f..19b4a3a49cca 100644 --- a/dockerfiles/Dockerfile.vendor +++ b/dockerfiles/Dockerfile.vendor @@ -20,9 +20,9 @@ RUN --mount=target=/context \ --mount=target=/go/pkg/mod,type=cache < The go line for each module sets the language version the compiler enforces -// > when compiling packages in that module. The language version can be changed -// > on a per-file basis by using a build constraint. -// > -// > For example, a module containing code that uses the Go 1.21 language version -// > should have a go.mod file with a go line such as go 1.21 or go 1.21.3. -// > If a specific source file should be compiled only when using a newer Go -// > toolchain, adding //go:build go1.22 to that source file both ensures that -// > only Go 1.22 and newer toolchains will compile the file and also changes -// > the language version in that file to Go 1.22. -// -// This file is a generated module that imports all packages provided in -// the repository, which replicates an external consumer using our code -// as a dependency in go-module mode, and verifies all files in those -// packages have the correct "//go:build " set. -// -// [DefaultGoModVersion]: https://github.com/golang/go/blob/58c28ba286dd0e98fe4cca80f5d64bbcb824a685/src/cmd/go/internal/gover/version.go#L15-L24 -// [2]: https://go.dev/doc/toolchain -func TestModuleCompatibility(t *testing.T) { - t.Log("all packages have the correct go version specified through //go:build") -} -` - -const modTemplate = `// Code generated by "{{ .Generator }}". DO NOT EDIT. - -{{.Dependencies}} -` diff --git a/scripts/build/binary b/scripts/build/binary index 139cc517fbdf..06adda90c38c 100755 --- a/scripts/build/binary +++ b/scripts/build/binary @@ -9,8 +9,6 @@ set -eu echo "Building $GO_LINKMODE $(basename "${TARGET}")" -export GO111MODULE=auto - if [ "$(go env GOOS)" = "windows" ]; then if [ ! -x "$(command -v goversioninfo)" ]; then >&2 echo "goversioninfo not found, skipping manifesting binary" diff --git a/scripts/build/plugins b/scripts/build/plugins index 634d3f9db740..844f234adb2c 100755 --- a/scripts/build/plugins +++ b/scripts/build/plugins @@ -21,5 +21,5 @@ for p in cli-plugins/examples/* "$@" ; do mkdir -p "$(dirname "${TARGET_PLUGIN}")" echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")" - (set -x ; GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}") + (set -x ; go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}") done diff --git a/scripts/build/trust-plugin b/scripts/build/trust-plugin index 97eb0d9ce2fa..68dc364daca7 100755 --- a/scripts/build/trust-plugin +++ b/scripts/build/trust-plugin @@ -24,6 +24,6 @@ TARGET_PLUGIN="$(dirname "${TARGET}")/docker-trust-${GOOS}-${GOARCH}" mkdir -p "$(dirname "${TARGET_PLUGIN}")" echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")" -(set -x ; GO111MODULE=auto go -C ./cmd/docker-trust build -o "../../${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE}) +(set -x ; go -C ./cmd/docker-trust build -o "../../${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE}) ln -sf "$(basename "${TARGET_PLUGIN}")" "$(dirname "${TARGET}")/docker-trust" diff --git a/scripts/docs/generate-man.sh b/scripts/docs/generate-man.sh index d001855dde0e..8929c6f0f67f 100755 --- a/scripts/docs/generate-man.sh +++ b/scripts/docs/generate-man.sh @@ -7,7 +7,7 @@ set -eu if ! command -v "$GO_MD2MAN" > /dev/null; then ( set -x - # note: this installs all tools defined in go.mod/vendor.mod + # note: this installs all tools defined in go.mod GOBIN="$(pwd)/build/tools" go install -mod=vendor tool ) GO_MD2MAN="$(pwd)/build/tools/go-md2man" diff --git a/scripts/test/e2e/run b/scripts/test/e2e/run index 6f1cc1a4c93d..4b54331ccb60 100755 --- a/scripts/test/e2e/run +++ b/scripts/test/e2e/run @@ -122,7 +122,6 @@ runtests() { PATH="$PWD/build/:/usr/bin:/usr/local/bin:/usr/local/go/bin" \ HOME="$HOME" \ DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-${GOARCH}" \ - GO111MODULE=auto \ "$(command -v gotestsum)" -- ${TESTDIRS:-./e2e/...} ${TESTFLAGS-} } diff --git a/scripts/vendor b/scripts/vendor index 714acafa0e26..38a4a2a9bd58 100755 --- a/scripts/vendor +++ b/scripts/vendor @@ -5,7 +5,7 @@ set -eu TYP=$1 usage() { - echo "usage: ./scripts/vendor " + echo "usage: ./scripts/vendor " exit 1 } @@ -18,7 +18,7 @@ update() { } validate() { - diff=$(git status --porcelain -- vendor.mod vendor.sum vendor) + diff=$(git status --porcelain -- go.mod go.sum vendor) if [ -n "$diff" ]; then echo >&2 'ERROR: Vendor result differs. Vendor your package with "make -f docker.Makefile vendor"' echo "$diff" diff --git a/scripts/with-go-mod.sh b/scripts/with-go-mod.sh deleted file mode 100755 index 3b9c9dd80534..000000000000 --- a/scripts/with-go-mod.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# -# This script is used to coerce certain commands which rely on the presence of -# a go.mod into working with our repository. It works by creating a fake -# go.mod, running a specified command (passed via arguments), and removing it -# when the command is finished. This script should be dropped when this -# repository is a proper Go module with a permanent go.mod. - -set -euo pipefail - -SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOTDIR="$(cd "${SCRIPTDIR}/.." && pwd)" - -cleanup_paths=() - -create_symlink() { - local target="$1" - local link="$2" - - if [ -e "$link" ]; then - # see https://superuser.com/a/196698 - if ! [ "$link" -ef "${ROOTDIR}/${target}" ]; then - echo "$(basename "$0"): WARN: $link exists but is not the expected symlink!" >&2 - echo "$(basename "$0"): WARN: Using your version instead of our generated version -- this may misbehave!" >&2 - fi - return - fi - - set -x - ln -s "$target" "$link" - cleanup_paths+=( "$link" ) -} - -create_symlink "vendor.mod" "${ROOTDIR}/go.mod" -create_symlink "vendor.sum" "${ROOTDIR}/go.sum" - -if [ "${#cleanup_paths[@]}" -gt 0 ]; then - trap 'rm -f "${cleanup_paths[@]}"' EXIT -fi - -GO111MODULE=on GOTOOLCHAIN=local "$@" diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE deleted file mode 100644 index 2a7cf70da6e4..000000000000 --- a/vendor/golang.org/x/mod/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2009 The Go Authors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/mod/PATENTS b/vendor/golang.org/x/mod/PATENTS deleted file mode 100644 index 733099041f84..000000000000 --- a/vendor/golang.org/x/mod/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go b/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go deleted file mode 100644 index 150f887e7a4b..000000000000 --- a/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lazyregexp is a thin wrapper over regexp, allowing the use of global -// regexp variables without forcing them to be compiled at init. -package lazyregexp - -import ( - "os" - "regexp" - "strings" - "sync" -) - -// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be -// compiled the first time it is needed. -type Regexp struct { - str string - once sync.Once - rx *regexp.Regexp -} - -func (r *Regexp) re() *regexp.Regexp { - r.once.Do(r.build) - return r.rx -} - -func (r *Regexp) build() { - r.rx = regexp.MustCompile(r.str) - r.str = "" -} - -func (r *Regexp) FindSubmatch(s []byte) [][]byte { - return r.re().FindSubmatch(s) -} - -func (r *Regexp) FindStringSubmatch(s string) []string { - return r.re().FindStringSubmatch(s) -} - -func (r *Regexp) FindStringSubmatchIndex(s string) []int { - return r.re().FindStringSubmatchIndex(s) -} - -func (r *Regexp) ReplaceAllString(src, repl string) string { - return r.re().ReplaceAllString(src, repl) -} - -func (r *Regexp) FindString(s string) string { - return r.re().FindString(s) -} - -func (r *Regexp) FindAllString(s string, n int) []string { - return r.re().FindAllString(s, n) -} - -func (r *Regexp) MatchString(s string) bool { - return r.re().MatchString(s) -} - -func (r *Regexp) SubexpNames() []string { - return r.re().SubexpNames() -} - -var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") - -// New creates a new lazy regexp, delaying the compiling work until it is first -// needed. If the code is being run as part of tests, the regexp compiling will -// happen immediately. -func New(str string) *Regexp { - lr := &Regexp{str: str} - if inTest { - // In tests, always compile the regexps early. - lr.re() - } - return lr -} diff --git a/vendor/golang.org/x/mod/modfile/print.go b/vendor/golang.org/x/mod/modfile/print.go deleted file mode 100644 index 48dbd82aec54..000000000000 --- a/vendor/golang.org/x/mod/modfile/print.go +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Module file printer. - -package modfile - -import ( - "bytes" - "fmt" - "strings" -) - -// Format returns a go.mod file as a byte slice, formatted in standard style. -func Format(f *FileSyntax) []byte { - pr := &printer{} - pr.file(f) - - // remove trailing blank lines - b := pr.Bytes() - for len(b) > 0 && b[len(b)-1] == '\n' && (len(b) == 1 || b[len(b)-2] == '\n') { - b = b[:len(b)-1] - } - return b -} - -// A printer collects the state during printing of a file or expression. -type printer struct { - bytes.Buffer // output buffer - comment []Comment // pending end-of-line comments - margin int // left margin (indent), a number of tabs -} - -// printf prints to the buffer. -func (p *printer) printf(format string, args ...any) { - fmt.Fprintf(p, format, args...) -} - -// indent returns the position on the current line, in bytes, 0-indexed. -func (p *printer) indent() int { - b := p.Bytes() - n := 0 - for n < len(b) && b[len(b)-1-n] != '\n' { - n++ - } - return n -} - -// newline ends the current line, flushing end-of-line comments. -func (p *printer) newline() { - if len(p.comment) > 0 { - p.printf(" ") - for i, com := range p.comment { - if i > 0 { - p.trim() - p.printf("\n") - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - } - p.printf("%s", strings.TrimSpace(com.Token)) - } - p.comment = p.comment[:0] - } - - p.trim() - if b := p.Bytes(); len(b) == 0 || (len(b) >= 2 && b[len(b)-1] == '\n' && b[len(b)-2] == '\n') { - // skip the blank line at top of file or after a blank line - } else { - p.printf("\n") - } - for i := 0; i < p.margin; i++ { - p.printf("\t") - } -} - -// trim removes trailing spaces and tabs from the current line. -func (p *printer) trim() { - // Remove trailing spaces and tabs from line we're about to end. - b := p.Bytes() - n := len(b) - for n > 0 && (b[n-1] == '\t' || b[n-1] == ' ') { - n-- - } - p.Truncate(n) -} - -// file formats the given file into the print buffer. -func (p *printer) file(f *FileSyntax) { - for _, com := range f.Before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - for i, stmt := range f.Stmt { - switch x := stmt.(type) { - case *CommentBlock: - // comments already handled - p.expr(x) - - default: - p.expr(x) - p.newline() - } - - for _, com := range stmt.Comment().After { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - - if i+1 < len(f.Stmt) { - p.newline() - } - } -} - -func (p *printer) expr(x Expr) { - // Emit line-comments preceding this expression. - if before := x.Comment().Before; len(before) > 0 { - // Want to print a line comment. - // Line comments must be at the current margin. - p.trim() - if p.indent() > 0 { - // There's other text on the line. Start a new line. - p.printf("\n") - } - // Re-indent to margin. - for i := 0; i < p.margin; i++ { - p.printf("\t") - } - for _, com := range before { - p.printf("%s", strings.TrimSpace(com.Token)) - p.newline() - } - } - - switch x := x.(type) { - default: - panic(fmt.Errorf("printer: unexpected type %T", x)) - - case *CommentBlock: - // done - - case *LParen: - p.printf("(") - case *RParen: - p.printf(")") - - case *Line: - p.tokens(x.Token) - - case *LineBlock: - p.tokens(x.Token) - p.printf(" ") - p.expr(&x.LParen) - p.margin++ - for _, l := range x.Line { - p.newline() - p.expr(l) - } - p.margin-- - p.newline() - p.expr(&x.RParen) - } - - // Queue end-of-line comments for printing when we - // reach the end of the line. - p.comment = append(p.comment, x.Comment().Suffix...) -} - -func (p *printer) tokens(tokens []string) { - sep := "" - for _, t := range tokens { - if t == "," || t == ")" || t == "]" || t == "}" { - sep = "" - } - p.printf("%s%s", sep, t) - sep = " " - if t == "(" || t == "[" || t == "{" { - sep = "" - } - } -} diff --git a/vendor/golang.org/x/mod/modfile/read.go b/vendor/golang.org/x/mod/modfile/read.go deleted file mode 100644 index 9e35e1ac51f3..000000000000 --- a/vendor/golang.org/x/mod/modfile/read.go +++ /dev/null @@ -1,962 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "bytes" - "errors" - "fmt" - "os" - "slices" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// A Position describes an arbitrary source position in a file, including the -// file, line, column, and byte offset. -type Position struct { - Line int // line in input (starting at 1) - LineRune int // rune in line (starting at 1) - Byte int // byte in input (starting at 0) -} - -// add returns the position at the end of s, assuming it starts at p. -func (p Position) add(s string) Position { - p.Byte += len(s) - if n := strings.Count(s, "\n"); n > 0 { - p.Line += n - s = s[strings.LastIndex(s, "\n")+1:] - p.LineRune = 1 - } - p.LineRune += utf8.RuneCountInString(s) - return p -} - -// An Expr represents an input element. -type Expr interface { - // Span returns the start and end position of the expression, - // excluding leading or trailing comments. - Span() (start, end Position) - - // Comment returns the comments attached to the expression. - // This method would normally be named 'Comments' but that - // would interfere with embedding a type of the same name. - Comment() *Comments -} - -// A Comment represents a single // comment. -type Comment struct { - Start Position - Token string // without trailing newline - Suffix bool // an end of line (not whole line) comment -} - -// Comments collects the comments associated with an expression. -type Comments struct { - Before []Comment // whole-line comments before this expression - Suffix []Comment // end-of-line comments after this expression - - // For top-level expressions only, After lists whole-line - // comments following the expression. - After []Comment -} - -// Comment returns the receiver. This isn't useful by itself, but -// a [Comments] struct is embedded into all the expression -// implementation types, and this gives each of those a Comment -// method to satisfy the Expr interface. -func (c *Comments) Comment() *Comments { - return c -} - -// A FileSyntax represents an entire go.mod file. -type FileSyntax struct { - Name string // file path - Comments - Stmt []Expr -} - -func (x *FileSyntax) Span() (start, end Position) { - if len(x.Stmt) == 0 { - return - } - start, _ = x.Stmt[0].Span() - _, end = x.Stmt[len(x.Stmt)-1].Span() - return start, end -} - -// addLine adds a line containing the given tokens to the file. -// -// If the first token of the hint matches the first token of the -// line, the new line is added at the end of the block containing hint, -// extracting hint into a new block if it is not yet in one. -// -// If the hint is non-nil but its first token does not match, -// the new line is added after the block containing hint -// (or hint itself, if not in a block). -// -// If no hint is provided, addLine appends the line to the end of -// the last block with a matching first token, -// or to the end of the file if no such block exists. -func (x *FileSyntax) addLine(hint Expr, tokens ...string) *Line { - if hint == nil { - // If no hint given, add to the last statement of the given type. - Loop: - for _, stmt := range slices.Backward(x.Stmt) { - switch stmt := stmt.(type) { - case *Line: - if stmt.Token != nil && stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - case *LineBlock: - if stmt.Token[0] == tokens[0] { - hint = stmt - break Loop - } - } - } - } - - newLineAfter := func(i int) *Line { - new := &Line{Token: tokens} - if i == len(x.Stmt) { - x.Stmt = append(x.Stmt, new) - } else { - x.Stmt = append(x.Stmt, nil) - copy(x.Stmt[i+2:], x.Stmt[i+1:]) - x.Stmt[i+1] = new - } - return new - } - - if hint != nil { - for i, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt == hint { - if stmt.Token == nil || stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Convert line to line block. - stmt.InBlock = true - block := &LineBlock{Token: stmt.Token[:1], Line: []*Line{stmt}} - stmt.Token = stmt.Token[1:] - x.Stmt[i] = block - new := &Line{Token: tokens[1:], InBlock: true} - block.Line = append(block.Line, new) - return new - } - - case *LineBlock: - if stmt == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line = append(stmt.Line, new) - return new - } - - for j, line := range stmt.Line { - if line == hint { - if stmt.Token[0] != tokens[0] { - return newLineAfter(i) - } - - // Add new line after hint within the block. - stmt.Line = append(stmt.Line, nil) - copy(stmt.Line[j+2:], stmt.Line[j+1:]) - new := &Line{Token: tokens[1:], InBlock: true} - stmt.Line[j+1] = new - return new - } - } - } - } - } - - new := &Line{Token: tokens} - x.Stmt = append(x.Stmt, new) - return new -} - -func (x *FileSyntax) updateLine(line *Line, tokens ...string) { - if line.InBlock { - tokens = tokens[1:] - } - line.Token = tokens -} - -// markRemoved modifies line so that it (and its end-of-line comment, if any) -// will be dropped by (*FileSyntax).Cleanup. -func (line *Line) markRemoved() { - line.Token = nil - line.Comments.Suffix = nil -} - -// Cleanup cleans up the file syntax x after any edit operations. -// To avoid quadratic behavior, (*Line).markRemoved marks the line as dead -// by setting line.Token = nil but does not remove it from the slice -// in which it appears. After edits have all been indicated, -// calling Cleanup cleans out the dead lines. -func (x *FileSyntax) Cleanup() { - w := 0 - for _, stmt := range x.Stmt { - switch stmt := stmt.(type) { - case *Line: - if stmt.Token == nil { - continue - } - case *LineBlock: - ww := 0 - for _, line := range stmt.Line { - if line.Token != nil { - stmt.Line[ww] = line - ww++ - } - } - if ww == 0 { - continue - } - if ww == 1 && len(stmt.RParen.Comments.Before) == 0 { - // Collapse block into single line but keep the Line reference used by the - // parsed File structure. - *stmt.Line[0] = Line{ - Comments: Comments{ - Before: commentsAdd(stmt.Before, stmt.Line[0].Before), - Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix), - After: commentsAdd(stmt.Line[0].After, stmt.After), - }, - Token: stringsAdd(stmt.Token, stmt.Line[0].Token), - } - x.Stmt[w] = stmt.Line[0] - w++ - continue - } - stmt.Line = stmt.Line[:ww] - } - x.Stmt[w] = stmt - w++ - } - x.Stmt = x.Stmt[:w] -} - -func commentsAdd(x, y []Comment) []Comment { - return append(x[:len(x):len(x)], y...) -} - -func stringsAdd(x, y []string) []string { - return append(x[:len(x):len(x)], y...) -} - -// A CommentBlock represents a top-level block of comments separate -// from any rule. -type CommentBlock struct { - Comments - Start Position -} - -func (x *CommentBlock) Span() (start, end Position) { - return x.Start, x.Start -} - -// A Line is a single line of tokens. -type Line struct { - Comments - Start Position - Token []string - InBlock bool - End Position -} - -func (x *Line) Span() (start, end Position) { - return x.Start, x.End -} - -// A LineBlock is a factored block of lines, like -// -// require ( -// "x" -// "y" -// ) -type LineBlock struct { - Comments - Start Position - LParen LParen - Token []string - Line []*Line - RParen RParen -} - -func (x *LineBlock) Span() (start, end Position) { - return x.Start, x.RParen.Pos.add(")") -} - -// An LParen represents the beginning of a parenthesized line block. -// It is a place to store suffix comments. -type LParen struct { - Comments - Pos Position -} - -func (x *LParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An RParen represents the end of a parenthesized line block. -// It is a place to store whole-line (before) comments. -type RParen struct { - Comments - Pos Position -} - -func (x *RParen) Span() (start, end Position) { - return x.Pos, x.Pos.add(")") -} - -// An input represents a single input file being parsed. -type input struct { - // Lexing state. - filename string // name of input file, for errors - complete []byte // entire input - remaining []byte // remaining input - tokenStart []byte // token being scanned to end of input - token token // next token to be returned by lex, peek - pos Position // current input position - comments []Comment // accumulated comments - - // Parser state. - file *FileSyntax // returned top-level syntax tree - parseErrors ErrorList // errors encountered during parsing - - // Comment assignment state. - pre []Expr // all expressions, in preorder traversal - post []Expr // all expressions, in postorder traversal -} - -func newInput(filename string, data []byte) *input { - return &input{ - filename: filename, - complete: data, - remaining: data, - pos: Position{Line: 1, LineRune: 1, Byte: 0}, - } -} - -// parse parses the input file. -func parse(file string, data []byte) (f *FileSyntax, err error) { - // The parser panics for both routine errors like syntax errors - // and for programmer bugs like array index errors. - // Turn both into error returns. Catching bug panics is - // especially important when processing many files. - in := newInput(file, data) - defer func() { - if e := recover(); e != nil && e != &in.parseErrors { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: fmt.Errorf("internal error: %v", e), - }) - } - if err == nil && len(in.parseErrors) > 0 { - err = in.parseErrors - } - }() - - // Prime the lexer by reading in the first token. It will be available - // in the next peek() or lex() call. - in.readToken() - - // Invoke the parser. - in.parseFile() - if len(in.parseErrors) > 0 { - return nil, in.parseErrors - } - in.file.Name = in.filename - - // Assign comments to nearby syntax. - in.assignComments() - - return in.file, nil -} - -// Error is called to report an error. -// Error does not return: it panics. -func (in *input) Error(s string) { - in.parseErrors = append(in.parseErrors, Error{ - Filename: in.filename, - Pos: in.pos, - Err: errors.New(s), - }) - panic(&in.parseErrors) -} - -// eof reports whether the input has reached end of file. -func (in *input) eof() bool { - return len(in.remaining) == 0 -} - -// peekRune returns the next rune in the input without consuming it. -func (in *input) peekRune() int { - if len(in.remaining) == 0 { - return 0 - } - r, _ := utf8.DecodeRune(in.remaining) - return int(r) -} - -// peekPrefix reports whether the remaining input begins with the given prefix. -func (in *input) peekPrefix(prefix string) bool { - // This is like bytes.HasPrefix(in.remaining, []byte(prefix)) - // but without the allocation of the []byte copy of prefix. - for i := 0; i < len(prefix); i++ { - if i >= len(in.remaining) || in.remaining[i] != prefix[i] { - return false - } - } - return true -} - -// readRune consumes and returns the next rune in the input. -func (in *input) readRune() int { - if len(in.remaining) == 0 { - in.Error("internal lexer error: readRune at EOF") - } - r, size := utf8.DecodeRune(in.remaining) - in.remaining = in.remaining[size:] - if r == '\n' { - in.pos.Line++ - in.pos.LineRune = 1 - } else { - in.pos.LineRune++ - } - in.pos.Byte += size - return int(r) -} - -type token struct { - kind tokenKind - pos Position - endPos Position - text string -} - -type tokenKind int - -const ( - _EOF tokenKind = -(iota + 1) - _EOLCOMMENT - _IDENT - _STRING - _COMMENT - - // newlines and punctuation tokens are allowed as ASCII codes. -) - -func (k tokenKind) isComment() bool { - return k == _COMMENT || k == _EOLCOMMENT -} - -// isEOL returns whether a token terminates a line. -func (k tokenKind) isEOL() bool { - return k == _EOF || k == _EOLCOMMENT || k == '\n' -} - -// startToken marks the beginning of the next input token. -// It must be followed by a call to endToken, once the token's text has -// been consumed using readRune. -func (in *input) startToken() { - in.tokenStart = in.remaining - in.token.text = "" - in.token.pos = in.pos -} - -// endToken marks the end of an input token. -// It records the actual token string in tok.text. -// A single trailing newline (LF or CRLF) will be removed from comment tokens. -func (in *input) endToken(kind tokenKind) { - in.token.kind = kind - text := string(in.tokenStart[:len(in.tokenStart)-len(in.remaining)]) - if kind.isComment() { - if strings.HasSuffix(text, "\r\n") { - text = text[:len(text)-2] - } else { - text = strings.TrimSuffix(text, "\n") - } - } - in.token.text = text - in.token.endPos = in.pos -} - -// peek returns the kind of the next token returned by lex. -func (in *input) peek() tokenKind { - return in.token.kind -} - -// lex is called from the parser to obtain the next input token. -func (in *input) lex() token { - tok := in.token - in.readToken() - return tok -} - -// readToken lexes the next token from the text and stores it in in.token. -func (in *input) readToken() { - // Skip past spaces, stopping at non-space or EOF. - for !in.eof() { - c := in.peekRune() - if c == ' ' || c == '\t' || c == '\r' { - in.readRune() - continue - } - - // Comment runs to end of line. - if in.peekPrefix("//") { - in.startToken() - - // Is this comment the only thing on its line? - // Find the last \n before this // and see if it's all - // spaces from there to here. - i := bytes.LastIndex(in.complete[:in.pos.Byte], []byte("\n")) - suffix := len(bytes.TrimSpace(in.complete[i+1:in.pos.Byte])) > 0 - in.readRune() - in.readRune() - - // Consume comment. - for len(in.remaining) > 0 && in.readRune() != '\n' { - } - - // If we are at top level (not in a statement), hand the comment to - // the parser as a _COMMENT token. The grammar is written - // to handle top-level comments itself. - if !suffix { - in.endToken(_COMMENT) - return - } - - // Otherwise, save comment for later attachment to syntax tree. - in.endToken(_EOLCOMMENT) - in.comments = append(in.comments, Comment{in.token.pos, in.token.text, suffix}) - return - } - - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - - // Found non-space non-comment. - break - } - - // Found the beginning of the next token. - in.startToken() - - // End of file. - if in.eof() { - in.endToken(_EOF) - return - } - - // Punctuation tokens. - switch c := in.peekRune(); c { - case '\n', '(', ')', '[', ']', '{', '}', ',': - in.readRune() - in.endToken(tokenKind(c)) - return - - case '"', '`': // quoted string - quote := c - in.readRune() - for { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - if in.peekRune() == '\n' { - in.Error("unexpected newline in string") - } - c := in.readRune() - if c == quote { - break - } - if c == '\\' && quote != '`' { - if in.eof() { - in.pos = in.token.pos - in.Error("unexpected EOF in string") - } - in.readRune() - } - } - in.endToken(_STRING) - return - } - - // Checked all punctuation. Must be identifier token. - if c := in.peekRune(); !isIdent(c) { - in.Error(fmt.Sprintf("unexpected input character %#q", rune(c))) - } - - // Scan over identifier. - for isIdent(in.peekRune()) { - if in.peekPrefix("//") { - break - } - if in.peekPrefix("/*") { - in.Error("mod files must use // comments (not /* */ comments)") - } - in.readRune() - } - in.endToken(_IDENT) -} - -// isIdent reports whether c is an identifier rune. -// We treat most printable runes as identifier runes, except for a handful of -// ASCII punctuation characters. -func isIdent(c int) bool { - switch r := rune(c); r { - case ' ', '(', ')', '[', ']', '{', '}', ',': - return false - default: - return !unicode.IsSpace(r) && unicode.IsPrint(r) - } -} - -// Comment assignment. -// We build two lists of all subexpressions, preorder and postorder. -// The preorder list is ordered by start location, with outer expressions first. -// The postorder list is ordered by end location, with outer expressions last. -// We use the preorder list to assign each whole-line comment to the syntax -// immediately following it, and we use the postorder list to assign each -// end-of-line comment to the syntax immediately preceding it. - -// order walks the expression adding it and its subexpressions to the -// preorder and postorder lists. -func (in *input) order(x Expr) { - if x != nil { - in.pre = append(in.pre, x) - } - switch x := x.(type) { - default: - panic(fmt.Errorf("order: unexpected type %T", x)) - case nil: - // nothing - case *LParen, *RParen: - // nothing - case *CommentBlock: - // nothing - case *Line: - // nothing - case *FileSyntax: - for _, stmt := range x.Stmt { - in.order(stmt) - } - case *LineBlock: - in.order(&x.LParen) - for _, l := range x.Line { - in.order(l) - } - in.order(&x.RParen) - } - if x != nil { - in.post = append(in.post, x) - } -} - -// assignComments attaches comments to nearby syntax. -func (in *input) assignComments() { - const debug = false - - // Generate preorder and postorder lists. - in.order(in.file) - - // Split into whole-line comments and suffix comments. - var line, suffix []Comment - for _, com := range in.comments { - if com.Suffix { - suffix = append(suffix, com) - } else { - line = append(line, com) - } - } - - if debug { - for _, c := range line { - fmt.Fprintf(os.Stderr, "LINE %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign line comments to syntax immediately following. - for _, x := range in.pre { - start, _ := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "pre %T :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte) - } - xcom := x.Comment() - for len(line) > 0 && start.Byte >= line[0].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN LINE %q #%d\n", line[0].Token, line[0].Start.Byte) - } - xcom.Before = append(xcom.Before, line[0]) - line = line[1:] - } - } - - // Remaining line comments go at end of file. - in.file.After = append(in.file.After, line...) - - if debug { - for _, c := range suffix { - fmt.Fprintf(os.Stderr, "SUFFIX %q :%d:%d #%d\n", c.Token, c.Start.Line, c.Start.LineRune, c.Start.Byte) - } - } - - // Assign suffix comments to syntax immediately before. - for _, x := range slices.Backward(in.post) { - start, end := x.Span() - if debug { - fmt.Fprintf(os.Stderr, "post %T :%d:%d #%d :%d:%d #%d\n", x, start.Line, start.LineRune, start.Byte, end.Line, end.LineRune, end.Byte) - } - - // Do not assign suffix comments to end of line block or whole file. - // Instead assign them to the last element inside. - switch x.(type) { - case *FileSyntax: - continue - } - - // Do not assign suffix comments to something that starts - // on an earlier line, so that in - // - // x ( y - // z ) // comment - // - // we assign the comment to z and not to x ( ... ). - if start.Line != end.Line { - continue - } - xcom := x.Comment() - for len(suffix) > 0 && end.Byte <= suffix[len(suffix)-1].Start.Byte { - if debug { - fmt.Fprintf(os.Stderr, "ASSIGN SUFFIX %q #%d\n", suffix[len(suffix)-1].Token, suffix[len(suffix)-1].Start.Byte) - } - xcom.Suffix = append(xcom.Suffix, suffix[len(suffix)-1]) - suffix = suffix[:len(suffix)-1] - } - } - - // We assigned suffix comments in reverse. - // If multiple suffix comments were appended to the same - // expression node, they are now in reverse. Fix that. - for _, x := range in.post { - reverseComments(x.Comment().Suffix) - } - - // Remaining suffix comments go at beginning of file. - in.file.Before = append(in.file.Before, suffix...) -} - -// reverseComments reverses the []Comment list. -func reverseComments(list []Comment) { - for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 { - list[i], list[j] = list[j], list[i] - } -} - -func (in *input) parseFile() { - in.file = new(FileSyntax) - var cb *CommentBlock - for { - switch in.peek() { - case '\n': - in.lex() - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - cb = nil - } - case _COMMENT: - tok := in.lex() - if cb == nil { - cb = &CommentBlock{Start: tok.pos} - } - com := cb.Comment() - com.Before = append(com.Before, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - if cb != nil { - in.file.Stmt = append(in.file.Stmt, cb) - } - return - default: - in.parseStmt() - if cb != nil { - in.file.Stmt[len(in.file.Stmt)-1].Comment().Before = cb.Before - cb = nil - } - } - } -} - -func (in *input) parseStmt() { - tok := in.lex() - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - switch { - case tok.kind.isEOL(): - in.file.Stmt = append(in.file.Stmt, &Line{ - Start: start, - Token: tokens, - End: end, - }) - return - - case tok.kind == '(': - if next := in.peek(); next.isEOL() { - // Start of block: no more tokens on this line. - in.file.Stmt = append(in.file.Stmt, in.parseLineBlock(start, tokens, tok)) - return - } else if next == ')' { - rparen := in.lex() - if in.peek().isEOL() { - // Empty block. - in.lex() - in.file.Stmt = append(in.file.Stmt, &LineBlock{ - Start: start, - Token: tokens, - LParen: LParen{Pos: tok.pos}, - RParen: RParen{Pos: rparen.pos}, - }) - return - } - // '( )' in the middle of the line, not a block. - tokens = append(tokens, tok.text, rparen.text) - } else { - // '(' in the middle of the line, not a block. - tokens = append(tokens, tok.text) - } - - default: - tokens = append(tokens, tok.text) - end = tok.endPos - } - } -} - -func (in *input) parseLineBlock(start Position, token []string, lparen token) *LineBlock { - x := &LineBlock{ - Start: start, - Token: token, - LParen: LParen{Pos: lparen.pos}, - } - var comments []Comment - for { - switch in.peek() { - case _EOLCOMMENT: - // Suffix comment, will be attached later by assignComments. - in.lex() - case '\n': - // Blank line. Add an empty comment to preserve it. - in.lex() - if len(comments) == 0 && len(x.Line) > 0 || len(comments) > 0 && comments[len(comments)-1].Token != "" { - comments = append(comments, Comment{}) - } - case _COMMENT: - tok := in.lex() - comments = append(comments, Comment{Start: tok.pos, Token: tok.text}) - case _EOF: - in.Error(fmt.Sprintf("syntax error (unterminated block started at %s:%d:%d)", in.filename, x.Start.Line, x.Start.LineRune)) - case ')': - rparen := in.lex() - // Don't preserve blank lines (denoted by a single empty comment, added above) - // at the end of the block. - if len(comments) == 1 && comments[0] == (Comment{}) { - comments = nil - } - x.RParen.Before = comments - x.RParen.Pos = rparen.pos - if !in.peek().isEOL() { - in.Error("syntax error (expected newline after closing paren)") - } - in.lex() - return x - default: - l := in.parseLine() - x.Line = append(x.Line, l) - l.Comment().Before = comments - comments = nil - } - } -} - -func (in *input) parseLine() *Line { - tok := in.lex() - if tok.kind.isEOL() { - in.Error("internal parse error: parseLine at end of line") - } - start := tok.pos - end := tok.endPos - tokens := []string{tok.text} - for { - tok := in.lex() - if tok.kind.isEOL() { - return &Line{ - Start: start, - Token: tokens, - End: end, - InBlock: true, - } - } - tokens = append(tokens, tok.text) - end = tok.endPos - } -} - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// ModulePath returns the module path from the go.mod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -func ModulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} diff --git a/vendor/golang.org/x/mod/modfile/rule.go b/vendor/golang.org/x/mod/modfile/rule.go deleted file mode 100644 index 5b2466fa9553..000000000000 --- a/vendor/golang.org/x/mod/modfile/rule.go +++ /dev/null @@ -1,1951 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package modfile implements a parser and formatter for go.mod files. -// -// The go.mod syntax is described in -// https://pkg.go.dev/cmd/go/#hdr-The_go_mod_file. -// -// The [Parse] and [ParseLax] functions both parse a go.mod file and return an -// abstract syntax tree. ParseLax ignores unknown statements and may be used to -// parse go.mod files that may have been developed with newer versions of Go. -// -// The [File] struct returned by Parse and ParseLax represent an abstract -// go.mod file. File has several methods like [File.AddNewRequire] and -// [File.DropReplace] that can be used to programmatically edit a file. -// -// The [Format] function formats a File back to a byte slice which can be -// written to a file. -package modfile - -import ( - "cmp" - "errors" - "fmt" - "path/filepath" - "slices" - "strconv" - "strings" - "unicode" - - "golang.org/x/mod/internal/lazyregexp" - "golang.org/x/mod/module" - "golang.org/x/mod/semver" -) - -// A File is the parsed, interpreted form of a go.mod file. -type File struct { - Module *Module - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Require []*Require - Exclude []*Exclude - Replace []*Replace - Retract []*Retract - Tool []*Tool - Ignore []*Ignore - - Syntax *FileSyntax -} - -// A Module is the module statement. -type Module struct { - Mod module.Version - Deprecated string - Syntax *Line -} - -// A Go is the go statement. -type Go struct { - Version string // "1.23" - Syntax *Line -} - -// A Toolchain is the toolchain statement. -type Toolchain struct { - Name string // "go1.21rc1" - Syntax *Line -} - -// A Godebug is a single godebug key=value statement. -type Godebug struct { - Key string - Value string - Syntax *Line -} - -// An Exclude is a single exclude statement. -type Exclude struct { - Mod module.Version - Syntax *Line -} - -// A Replace is a single replace statement. -type Replace struct { - Old module.Version - New module.Version - Syntax *Line -} - -// A Retract is a single retract statement. -type Retract struct { - VersionInterval - Rationale string - Syntax *Line -} - -// A Tool is a single tool statement. -type Tool struct { - Path string - Syntax *Line -} - -// An Ignore is a single ignore statement. -type Ignore struct { - Path string - Syntax *Line -} - -// A VersionInterval represents a range of versions with upper and lower bounds. -// Intervals are closed: both bounds are included. When Low is equal to High, -// the interval may refer to a single version ('v1.2.3') or an interval -// ('[v1.2.3, v1.2.3]'); both have the same representation. -type VersionInterval struct { - Low, High string -} - -// A Require is a single require statement. -type Require struct { - Mod module.Version - Indirect bool // has "// indirect" comment - Syntax *Line -} - -func (r *Require) markRemoved() { - r.Syntax.markRemoved() - *r = Require{} -} - -func (r *Require) setVersion(v string) { - r.Mod.Version = v - - if line := r.Syntax; len(line.Token) > 0 { - if line.InBlock { - // If the line is preceded by an empty line, remove it; see - // https://golang.org/issue/33779. - if len(line.Comments.Before) == 1 && len(line.Comments.Before[0].Token) == 0 { - line.Comments.Before = line.Comments.Before[:0] - } - if len(line.Token) >= 2 { // example.com v1.2.3 - line.Token[1] = v - } - } else { - if len(line.Token) >= 3 { // require example.com v1.2.3 - line.Token[2] = v - } - } - } -} - -// setIndirect sets line to have (or not have) a "// indirect" comment. -func (r *Require) setIndirect(indirect bool) { - r.Indirect = indirect - line := r.Syntax - if isIndirect(line) == indirect { - return - } - if indirect { - // Adding comment. - if len(line.Suffix) == 0 { - // New comment. - line.Suffix = []Comment{{Token: "// indirect", Suffix: true}} - return - } - - com := &line.Suffix[0] - text := strings.TrimSpace(strings.TrimPrefix(com.Token, string(slashSlash))) - if text == "" { - // Empty comment. - com.Token = "// indirect" - return - } - - // Insert at beginning of existing comment. - com.Token = "// indirect; " + text - return - } - - // Removing comment. - f := strings.TrimSpace(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - if f == "indirect" { - // Remove whole comment. - line.Suffix = nil - return - } - - // Remove comment prefix. - com := &line.Suffix[0] - i := strings.Index(com.Token, "indirect;") - com.Token = "//" + com.Token[i+len("indirect;"):] -} - -// isIndirect reports whether line has a "// indirect" comment, -// meaning it is in go.mod only for its effect on indirect dependencies, -// so that it can be dropped entirely once the effective version of the -// indirect dependency reaches the given minimum version. -func isIndirect(line *Line) bool { - if len(line.Suffix) == 0 { - return false - } - f := strings.Fields(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash))) - return (len(f) == 1 && f[0] == "indirect" || len(f) > 1 && f[0] == "indirect;") -} - -func (f *File) AddModuleStmt(path string) error { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - if f.Module == nil { - f.Module = &Module{ - Mod: module.Version{Path: path}, - Syntax: f.Syntax.addLine(nil, "module", AutoQuote(path)), - } - } else { - f.Module.Mod.Path = path - f.Syntax.updateLine(f.Module.Syntax, "module", AutoQuote(path)) - } - return nil -} - -func (f *File) AddComment(text string) { - if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Syntax.Stmt = append(f.Syntax.Stmt, &CommentBlock{ - Comments: Comments{ - Before: []Comment{ - { - Token: text, - }, - }, - }, - }) -} - -type VersionFixer func(path, version string) (string, error) - -// errDontFix is returned by a VersionFixer to indicate the version should be -// left alone, even if it's not canonical. -var dontFixRetract VersionFixer = func(_, vers string) (string, error) { - return vers, nil -} - -// Parse parses and returns a go.mod file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func Parse(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, true) -} - -// ParseLax is like Parse but ignores unknown statements. -// It is used when parsing go.mod files other than the main module, -// under the theory that most statement types we add in the future will -// only apply in the main module, like exclude and replace, -// and so we get better gradual deployments if old go commands -// simply ignore those statements when found in go.mod files -// in dependencies. -func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) { - return parseToFile(file, data, fix, false) -} - -func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parsed *File, err error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &File{ - Syntax: fs, - } - var errs ErrorList - - // fix versions in retract directives after the file is parsed. - // We need the module path to fix versions, and it might be at the end. - defer func() { - oldLen := len(errs) - f.fixRetract(fix, &errs) - if len(errs) > oldLen { - parsed, err = nil, errs - } - }() - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, nil, x, x.Token[0], x.Token[1:], fix, strict) - - case *LineBlock: - if len(x.Token) > 1 { - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - } - switch x.Token[0] { - default: - if strict { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - } - continue - case "module", "godebug", "require", "exclude", "replace", "retract", "tool", "ignore": - for _, l := range x.Line { - f.add(&errs, x, l, x.Token[0], l.Token, fix, strict) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))?([a-z]+[0-9]+)?$`) - -var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9].*)$`) - -// Toolchains must be named beginning with `go1`, -// like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted. -// Note that this regexp is a much looser condition than go/version.IsValid, -// for forward compatibility. -// (This code has to be work to identify new toolchains even if we tweak the syntax in the future.) -var ToolchainRE = lazyregexp.New(`^default$|^go1($|\.)`) - -func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, args []string, fix VersionFixer, strict bool) { - // If strict is false, this module is a dependency. - // We ignore all unknown directives as well as main-module-only - // directives like replace and exclude. It will work better for - // forward compatibility if we can depend on modules that have unknown - // statements (presumed relevant only when acting as the main module) - // and simply ignore those statements. - if !strict { - switch verb { - case "go", "module", "retract", "require", "ignore": - // want these even for dependency go.mods - default: - return - } - } - - wrapModPathError := func(modPath string, err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - }) - } - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...any) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - fixed := false - if !strict { - if m := laxGoVersionRE.FindStringSubmatch(args[0]); m != nil { - args[0] = m[1] - fixed = true - } - } - if !fixed { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "module": - if f.Module != nil { - errorf("repeated module statement") - return - } - deprecated := parseDeprecation(block, line) - f.Module = &Module{ - Syntax: line, - Deprecated: deprecated, - } - if len(args) != 1 { - errorf("usage: module module/path") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Module.Mod = module.Version{Path: s} - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "require", "exclude": - if len(args) != 2 { - errorf("usage: %s module/path v1.2.3", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - v, err := parseVersion(verb, s, &args[1], fix) - if err != nil { - wrapError(err) - return - } - pathMajor, err := modulePathMajor(s) - if err != nil { - wrapError(err) - return - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - wrapModPathError(s, err) - return - } - if verb == "require" { - f.Require = append(f.Require, &Require{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - Indirect: isIndirect(line), - }) - } else { - f.Exclude = append(f.Exclude, &Exclude{ - Mod: module.Version{Path: s, Version: v}, - Syntax: line, - }) - } - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - - case "retract": - rationale := parseDirectiveComment(block, line) - vi, err := parseVersionInterval(verb, "", &args, dontFixRetract) - if err != nil { - if strict { - wrapError(err) - return - } else { - // Only report errors parsing intervals in the main module. We may - // support additional syntax in the future, such as open and half-open - // intervals. Those can't be supported now, because they break the - // go.mod parser, even in lax mode. - return - } - } - if len(args) > 0 && strict { - // In the future, there may be additional information after the version. - errorf("unexpected token after version: %q", args[0]) - return - } - retract := &Retract{ - VersionInterval: vi, - Rationale: rationale, - Syntax: line, - } - f.Retract = append(f.Retract, retract) - - case "tool": - if len(args) != 1 { - errorf("tool directive expects exactly one argument") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Tool = append(f.Tool, &Tool{ - Path: s, - Syntax: line, - }) - - case "ignore": - if len(args) != 1 { - errorf("ignore directive expects exactly one argument") - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Ignore = append(f.Ignore, &Ignore{ - Path: s, - Syntax: line, - }) - } -} - -func parseReplace(filename string, line *Line, verb string, args []string, fix VersionFixer) (*Replace, *Error) { - wrapModPathError := func(modPath string, err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - ModPath: modPath, - Verb: verb, - Err: err, - } - } - wrapError := func(err error) *Error { - return &Error{ - Filename: filename, - Pos: line.Start, - Err: err, - } - } - errorf := func(format string, args ...any) *Error { - return wrapError(fmt.Errorf(format, args...)) - } - - arrow := 2 - if len(args) >= 2 && args[1] == "=>" { - arrow = 1 - } - if len(args) < arrow+2 || len(args) > arrow+3 || args[arrow] != "=>" { - return nil, errorf("usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory", verb, verb) - } - s, err := parseString(&args[0]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - pathMajor, err := modulePathMajor(s) - if err != nil { - return nil, wrapModPathError(s, err) - - } - var v string - if arrow == 2 { - v, err = parseVersion(verb, s, &args[1], fix) - if err != nil { - return nil, wrapError(err) - } - if err := module.CheckPathMajor(v, pathMajor); err != nil { - return nil, wrapModPathError(s, err) - } - } - ns, err := parseString(&args[arrow+1]) - if err != nil { - return nil, errorf("invalid quoted string: %v", err) - } - nv := "" - if len(args) == arrow+2 { - if !IsDirectoryPath(ns) { - if strings.Contains(ns, "@") { - return nil, errorf("replacement module must match format 'path version', not 'path@version'") - } - return nil, errorf("replacement module without version must be directory path (rooted or starting with . or ..)") - } - if filepath.Separator == '/' && strings.Contains(ns, `\`) { - return nil, errorf("replacement directory appears to be Windows path (on a non-windows system)") - } - } - if len(args) == arrow+3 { - nv, err = parseVersion(verb, ns, &args[arrow+2], fix) - if err != nil { - return nil, wrapError(err) - } - if IsDirectoryPath(ns) { - return nil, errorf("replacement module directory path %q cannot have version", ns) - } - } - return &Replace{ - Old: module.Version{Path: s, Version: v}, - New: module.Version{Path: ns, Version: nv}, - Syntax: line, - }, nil -} - -// fixRetract applies fix to each retract directive in f, appending any errors -// to errs. -// -// Most versions are fixed as we parse the file, but for retract directives, -// the relevant module path is the one specified with the module directive, -// and that might appear at the end of the file (or not at all). -func (f *File) fixRetract(fix VersionFixer, errs *ErrorList) { - if fix == nil { - return - } - path := "" - if f.Module != nil { - path = f.Module.Mod.Path - } - var r *Retract - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: r.Syntax.Start, - Err: err, - }) - } - - for _, r = range f.Retract { - if path == "" { - wrapError(errors.New("no module directive found, so retract cannot be used")) - return // only print the first one of these - } - - args := r.Syntax.Token - if args[0] == "retract" { - args = args[1:] - } - vi, err := parseVersionInterval("retract", path, &args, fix) - if err != nil { - wrapError(err) - } - r.VersionInterval = vi - } -} - -func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, fix VersionFixer) { - wrapError := func(err error) { - *errs = append(*errs, Error{ - Filename: f.Syntax.Name, - Pos: line.Start, - Err: err, - }) - } - errorf := func(format string, args ...any) { - wrapError(fmt.Errorf(format, args...)) - } - - switch verb { - default: - errorf("unknown directive: %s", verb) - - case "go": - if f.Go != nil { - errorf("repeated go statement") - return - } - if len(args) != 1 { - errorf("go directive expects exactly one argument") - return - } else if !GoVersionRE.MatchString(args[0]) { - errorf("invalid go version '%s': must match format 1.23.0", args[0]) - return - } - - f.Go = &Go{Syntax: line} - f.Go.Version = args[0] - - case "toolchain": - if f.Toolchain != nil { - errorf("repeated toolchain statement") - return - } - if len(args) != 1 { - errorf("toolchain directive expects exactly one argument") - return - } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) - return - } - - f.Toolchain = &Toolchain{Syntax: line} - f.Toolchain.Name = args[0] - - case "godebug": - if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { - errorf("usage: godebug key=value") - return - } - key, value, ok := strings.Cut(args[0], "=") - if !ok { - errorf("usage: godebug key=value") - return - } - f.Godebug = append(f.Godebug, &Godebug{ - Key: key, - Value: value, - Syntax: line, - }) - - case "use": - if len(args) != 1 { - errorf("usage: %s local/dir", verb) - return - } - s, err := parseString(&args[0]) - if err != nil { - errorf("invalid quoted string: %v", err) - return - } - f.Use = append(f.Use, &Use{ - Path: s, - Syntax: line, - }) - - case "replace": - replace, wrappederr := parseReplace(f.Syntax.Name, line, verb, args, fix) - if wrappederr != nil { - *errs = append(*errs, *wrappederr) - return - } - f.Replace = append(f.Replace, replace) - } -} - -// IsDirectoryPath reports whether the given path should be interpreted as a directory path. -// Just like on the go command line, relative paths starting with a '.' or '..' path component -// and rooted paths are directory paths; the rest are module paths. -func IsDirectoryPath(ns string) bool { - // Because go.mod files can move from one system to another, - // we check all known path syntaxes, both Unix and Windows. - return ns == "." || strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, `.\`) || - ns == ".." || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, `..\`) || - strings.HasPrefix(ns, "/") || strings.HasPrefix(ns, `\`) || - len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':' -} - -// MustQuote reports whether s must be quoted in order to appear as -// a single token in a go.mod line. -func MustQuote(s string) bool { - for _, r := range s { - switch r { - case ' ', '"', '\'', '`': - return true - - case '(', ')', '[', ']', '{', '}', ',': - if len(s) > 1 { - return true - } - - default: - if !unicode.IsPrint(r) { - return true - } - } - } - return s == "" || strings.Contains(s, "//") || strings.Contains(s, "/*") -} - -// AutoQuote returns s or, if quoting is required for s to appear in a go.mod, -// the quotation of s. -func AutoQuote(s string) string { - if MustQuote(s) { - return strconv.Quote(s) - } - return s -} - -func parseVersionInterval(verb string, path string, args *[]string, fix VersionFixer) (VersionInterval, error) { - toks := *args - if len(toks) == 0 || toks[0] == "(" { - return VersionInterval{}, fmt.Errorf("expected '[' or version") - } - if toks[0] != "[" { - v, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - *args = toks[1:] - return VersionInterval{Low: v, High: v}, nil - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after '['") - } - low, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "," { - return VersionInterval{}, fmt.Errorf("expected ',' after version") - } - toks = toks[1:] - - if len(toks) == 0 { - return VersionInterval{}, fmt.Errorf("expected version after ','") - } - high, err := parseVersion(verb, path, &toks[0], fix) - if err != nil { - return VersionInterval{}, err - } - toks = toks[1:] - - if len(toks) == 0 || toks[0] != "]" { - return VersionInterval{}, fmt.Errorf("expected ']' after version") - } - toks = toks[1:] - - *args = toks - return VersionInterval{Low: low, High: high}, nil -} - -func parseString(s *string) (string, error) { - t := *s - if strings.HasPrefix(t, `"`) { - var err error - if t, err = strconv.Unquote(t); err != nil { - return "", err - } - } else if strings.ContainsAny(t, "\"'`") { - // Other quotes are reserved both for possible future expansion - // and to avoid confusion. For example if someone types 'x' - // we want that to be a syntax error and not a literal x in literal quotation marks. - return "", fmt.Errorf("unquoted string cannot contain quote") - } - *s = AutoQuote(t) - return t, nil -} - -var deprecatedRE = lazyregexp.New(`(?s)(?:^|\n\n)Deprecated: *(.*?)(?:$|\n\n)`) - -// parseDeprecation extracts the text of comments on a "module" directive and -// extracts a deprecation message from that. -// -// A deprecation message is contained in a paragraph within a block of comments -// that starts with "Deprecated:" (case sensitive). The message runs until the -// end of the paragraph and does not include the "Deprecated:" prefix. If the -// comment block has multiple paragraphs that start with "Deprecated:", -// parseDeprecation returns the message from the first. -func parseDeprecation(block *LineBlock, line *Line) string { - text := parseDirectiveComment(block, line) - m := deprecatedRE.FindStringSubmatch(text) - if m == nil { - return "" - } - return m[1] -} - -// parseDirectiveComment extracts the text of comments on a directive. -// If the directive's line does not have comments and is part of a block that -// does have comments, the block's comments are used. -func parseDirectiveComment(block *LineBlock, line *Line) string { - comments := line.Comment() - if block != nil && len(comments.Before) == 0 && len(comments.Suffix) == 0 { - comments = block.Comment() - } - groups := [][]Comment{comments.Before, comments.Suffix} - var lines []string - for _, g := range groups { - for _, c := range g { - if !strings.HasPrefix(c.Token, "//") { - continue // blank line - } - lines = append(lines, strings.TrimSpace(strings.TrimPrefix(c.Token, "//"))) - } - } - return strings.Join(lines, "\n") -} - -type ErrorList []Error - -func (e ErrorList) Error() string { - errStrs := make([]string, len(e)) - for i, err := range e { - errStrs[i] = err.Error() - } - return strings.Join(errStrs, "\n") -} - -type Error struct { - Filename string - Pos Position - Verb string - ModPath string - Err error -} - -func (e *Error) Error() string { - var pos string - if e.Pos.LineRune > 1 { - // Don't print LineRune if it's 1 (beginning of line). - // It's always 1 except in scanner errors, which are rare. - pos = fmt.Sprintf("%s:%d:%d: ", e.Filename, e.Pos.Line, e.Pos.LineRune) - } else if e.Pos.Line > 0 { - pos = fmt.Sprintf("%s:%d: ", e.Filename, e.Pos.Line) - } else if e.Filename != "" { - pos = fmt.Sprintf("%s: ", e.Filename) - } - - var directive string - if e.ModPath != "" { - directive = fmt.Sprintf("%s %s: ", e.Verb, e.ModPath) - } else if e.Verb != "" { - directive = fmt.Sprintf("%s: ", e.Verb) - } - - return pos + directive + e.Err.Error() -} - -func (e *Error) Unwrap() error { return e.Err } - -func parseVersion(verb string, path string, s *string, fix VersionFixer) (string, error) { - t, err := parseString(s) - if err != nil { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: *s, - Err: err, - }, - } - } - if fix != nil { - fixed, err := fix(path, t) - if err != nil { - if err, ok := err.(*module.ModuleError); ok { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: err.Err, - } - } - return "", err - } - t = fixed - } else { - cv := module.CanonicalVersion(t) - if cv == "" { - return "", &Error{ - Verb: verb, - ModPath: path, - Err: &module.InvalidVersionError{ - Version: t, - Err: errors.New("must be of the form v1.2.3"), - }, - } - } - t = cv - } - *s = t - return *s, nil -} - -func modulePathMajor(path string) (string, error) { - _, major, ok := module.SplitPathVersion(path) - if !ok { - return "", fmt.Errorf("invalid module path") - } - return major, nil -} - -func (f *File) Format() ([]byte, error) { - return Format(f.Syntax), nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [File.DropRequire] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *File) Cleanup() { - w := 0 - for _, g := range f.Godebug { - if g.Key != "" { - f.Godebug[w] = g - w++ - } - } - f.Godebug = f.Godebug[:w] - - w = 0 - for _, r := range f.Require { - if r.Mod.Path != "" { - f.Require[w] = r - w++ - } - } - f.Require = f.Require[:w] - - w = 0 - for _, x := range f.Exclude { - if x.Mod.Path != "" { - f.Exclude[w] = x - w++ - } - } - f.Exclude = f.Exclude[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - w = 0 - for _, r := range f.Retract { - if r.Low != "" || r.High != "" { - f.Retract[w] = r - w++ - } - } - f.Retract = f.Retract[:w] - - f.Syntax.Cleanup() -} - -func (f *File) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - var hint Expr - if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } else if f.Syntax == nil { - f.Syntax = new(FileSyntax) - } - f.Go = &Go{ - Version: version, - Syntax: f.Syntax.addLine(hint, "go", version), - } - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *File) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *File) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -func (f *File) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - var hint Expr - if f.Go != nil && f.Go.Syntax != nil { - hint = f.Go.Syntax - } else if f.Module != nil && f.Module.Syntax != nil { - hint = f.Module.Syntax - } - f.Toolchain = &Toolchain{ - Name: name, - Syntax: f.Syntax.addLine(hint, "toolchain", name), - } - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *File) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *File) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -// AddRequire sets the first require line for path to version vers, -// preserving any existing comments for that line and removing all -// other lines for path. -// -// If no line currently exists for path, AddRequire adds a new line -// at the end of the last require block. -func (f *File) AddRequire(path, vers string) error { - need := true - for _, r := range f.Require { - if r.Mod.Path == path { - if need { - r.Mod.Version = vers - f.Syntax.updateLine(r.Syntax, "require", AutoQuote(path), vers) - need = false - } else { - r.Syntax.markRemoved() - *r = Require{} - } - } - } - - if need { - f.AddNewRequire(path, vers, false) - } - return nil -} - -// AddNewRequire adds a new require line for path at version vers at the end of -// the last require block, regardless of any existing require lines for path. -func (f *File) AddNewRequire(path, vers string, indirect bool) { - line := f.Syntax.addLine(nil, "require", AutoQuote(path), vers) - r := &Require{ - Mod: module.Version{Path: path, Version: vers}, - Syntax: line, - } - r.setIndirect(indirect) - f.Require = append(f.Require, r) -} - -// SetRequire updates the requirements of f to contain exactly req, preserving -// the existing block structure and line comment contents (except for 'indirect' -// markings) for the first requirement on each named module path. -// -// The Syntax field is ignored for the requirements in req. -// -// Any requirements not already present in the file are added to the block -// containing the last require line. -// -// The requirements in req must specify at most one distinct version for each -// module path. -// -// If any existing requirements may be removed, the caller should call -// [File.Cleanup] after all edits are complete. -func (f *File) SetRequire(req []*Require) { - type elem struct { - version string - indirect bool - } - need := make(map[string]elem) - for _, r := range req { - if prev, dup := need[r.Mod.Path]; dup && prev.version != r.Mod.Version { - panic(fmt.Errorf("SetRequire called with conflicting versions for path %s (%s and %s)", r.Mod.Path, prev.version, r.Mod.Version)) - } - need[r.Mod.Path] = elem{r.Mod.Version, r.Indirect} - } - - // Update or delete the existing Require entries to preserve - // only the first for each module path in req. - for _, r := range f.Require { - e, ok := need[r.Mod.Path] - if ok { - r.setVersion(e.version) - r.setIndirect(e.indirect) - } else { - r.markRemoved() - } - delete(need, r.Mod.Path) - } - - // Add new entries in the last block of the file for any paths that weren't - // already present. - // - // This step is nondeterministic, but the final result will be deterministic - // because we will sort the block. - for path, e := range need { - f.AddNewRequire(path, e.version, e.indirect) - } - - f.SortBlocks() -} - -// SetRequireSeparateIndirect updates the requirements of f to contain the given -// requirements. Comment contents (except for 'indirect' markings) are retained -// from the first existing requirement for each module path. Like SetRequire, -// SetRequireSeparateIndirect adds requirements for new paths in req, -// updates the version and "// indirect" comment on existing requirements, -// and deletes requirements on paths not in req. Existing duplicate requirements -// are deleted. -// -// As its name suggests, SetRequireSeparateIndirect puts direct and indirect -// requirements into two separate blocks, one containing only direct -// requirements, and the other containing only indirect requirements. -// SetRequireSeparateIndirect may move requirements between these two blocks -// when their indirect markings change. However, SetRequireSeparateIndirect -// won't move requirements from other blocks, especially blocks with comments. -// -// If the file initially has one uncommented block of requirements, -// SetRequireSeparateIndirect will split it into a direct-only and indirect-only -// block. This aids in the transition to separate blocks. -func (f *File) SetRequireSeparateIndirect(req []*Require) { - f.setRequireSeparateIndirect(req, false) -} - -// SetRequireAtMostTwo is like SetRequireSeparateIndirect but it aggressively -// consolidates all requirements into at most two blocks (one direct, one indirect). -// It ignores existing blocks and comments when deciding where to place requirements. -func (f *File) SetRequireAtMostTwo(req []*Require) { - f.setRequireSeparateIndirect(req, true) -} - -func (f *File) setRequireSeparateIndirect(req []*Require, simplify bool) { - // hasComments returns whether a line or block has comments - // other than "indirect". - hasComments := func(c Comments) bool { - return len(c.Before) > 0 || len(c.After) > 0 || len(c.Suffix) > 1 || - (len(c.Suffix) == 1 && - strings.TrimSpace(strings.TrimPrefix(c.Suffix[0].Token, string(slashSlash))) != "indirect") - } - - // moveReq adds r to block. If r was in another block, moveReq deletes - // it from that block and transfers its comments. - moveReq := func(r *Require, block *LineBlock) { - var line *Line - if r.Syntax == nil { - line = &Line{Token: []string{AutoQuote(r.Mod.Path), r.Mod.Version}} - r.Syntax = line - if r.Indirect { - r.setIndirect(true) - } - } else { - line = new(Line) - *line = *r.Syntax - if !line.InBlock && len(line.Token) > 0 && line.Token[0] == "require" { - line.Token = line.Token[1:] - } - r.Syntax.Token = nil // Cleanup will delete the old line. - r.Syntax = line - } - line.InBlock = true - block.Line = append(block.Line, line) - } - - // Examine existing require lines and blocks. - need := make(map[string]*Require) - for _, r := range req { - need[r.Mod.Path] = r - } - lineIndirect := make(map[*Line]bool) - for _, r := range f.Require { - if n := need[r.Mod.Path]; n != nil { - lineIndirect[r.Syntax] = n.Indirect - } - } - - var ( - // We may insert new requirements into the last uncommented - // direct-only and indirect-only blocks. We may also move requirements - // to the opposite block if their indirect markings change. - lastDirectIndex = -1 - lastIndirectIndex = -1 - - // If there are no direct-only or indirect-only blocks, a new block may - // be inserted after the last require line or block. - lastRequireIndex = -1 - - // If there's only one require line or block, and it's uncommented, - // we'll move its requirements to the direct-only or indirect-only blocks. - requireLineOrBlockCount = 0 - - // Track the block each requirement belongs to (if any) so we can - // move them later. - lineToBlock = make(map[*Line]*LineBlock) - directBlockComments []Comment - indirectBlockComments []Comment - ) - for i, stmt := range f.Syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - if !hasComments(stmt.Comments) { - if isIndirect(stmt) { - lastIndirectIndex = i - } else { - lastDirectIndex = i - } - } - - case *LineBlock: - if len(stmt.Token) == 0 || stmt.Token[0] != "require" { - continue - } - lastRequireIndex = i - requireLineOrBlockCount++ - allDirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - allIndirect := len(stmt.Line) > 0 && !hasComments(stmt.Comments) - for _, line := range stmt.Line { - lineToBlock[line] = stmt - if hasComments(line.Comments) { - allDirect = false - allIndirect = false - } else if isIndirect(line) { - allDirect = false - } else { - allIndirect = false - } - } - if allDirect { - lastDirectIndex = i - } - if allIndirect { - lastIndirectIndex = i - } - if simplify { - anyDirect := false - for _, line := range stmt.Line { - if ind, ok := lineIndirect[line]; ok && !ind { - anyDirect = true - break - } - } - target := &directBlockComments - if !anyDirect && len(stmt.Line) > 0 { - target = &indirectBlockComments - } - if len(*target) > 0 && len(stmt.Comments.Before) > 0 { - *target = append(*target, Comment{Token: "//"}) - } - *target = append(*target, stmt.Comments.Before...) - stmt.Comments.Before = nil - } - } - } - - oneFlatUncommentedBlock := requireLineOrBlockCount == 1 && - !hasComments(*f.Syntax.Stmt[lastRequireIndex].Comment()) - - // Create direct and indirect blocks if needed. Convert lines into blocks - // if needed. If we end up with an empty block or a one-line block, - // Cleanup will delete it or convert it to a line later. - insertBlock := func(i int) *LineBlock { - block := &LineBlock{Token: []string{"require"}} - f.Syntax.Stmt = append(f.Syntax.Stmt, nil) - copy(f.Syntax.Stmt[i+1:], f.Syntax.Stmt[i:]) - f.Syntax.Stmt[i] = block - return block - } - - ensureBlock := func(i int) *LineBlock { - switch stmt := f.Syntax.Stmt[i].(type) { - case *LineBlock: - return stmt - case *Line: - block := &LineBlock{ - Token: []string{"require"}, - Line: []*Line{stmt}, - } - stmt.Token = stmt.Token[1:] // remove "require" - stmt.InBlock = true - f.Syntax.Stmt[i] = block - return block - default: - panic(fmt.Sprintf("unexpected statement: %v", stmt)) - } - } - - var lastDirectBlock *LineBlock - if lastDirectIndex < 0 { - if lastIndirectIndex >= 0 { - lastDirectIndex = lastIndirectIndex - lastIndirectIndex++ - } else if lastRequireIndex >= 0 { - lastDirectIndex = lastRequireIndex + 1 - } else { - lastDirectIndex = len(f.Syntax.Stmt) - } - lastDirectBlock = insertBlock(lastDirectIndex) - } else { - lastDirectBlock = ensureBlock(lastDirectIndex) - } - - var lastIndirectBlock *LineBlock - if lastIndirectIndex < 0 { - lastIndirectIndex = lastDirectIndex + 1 - lastIndirectBlock = insertBlock(lastIndirectIndex) - } else { - lastIndirectBlock = ensureBlock(lastIndirectIndex) - } - - if simplify { - if len(directBlockComments) > 0 { - lastDirectBlock.Comments.Before = append(lastDirectBlock.Comments.Before, directBlockComments...) - } - if len(indirectBlockComments) > 0 { - lastIndirectBlock.Comments.Before = append(lastIndirectBlock.Comments.Before, indirectBlockComments...) - } - } - - // Delete requirements we don't want anymore. - // Update versions and indirect comments on requirements we want to keep. - // If a requirement is in last{Direct,Indirect}Block with the wrong - // indirect marking after this, or if the requirement is in a single - // uncommented mixed block (oneFlatUncommentedBlock), move it to the - // correct block. - // - // Some blocks may be empty after this. Cleanup will remove them. - have := make(map[string]*Require) - for _, r := range f.Require { - path := r.Mod.Path - if need[path] == nil || have[path] != nil { - // Requirement not needed, or duplicate requirement. Delete. - r.markRemoved() - continue - } - have[r.Mod.Path] = r - r.setVersion(need[path].Mod.Version) - r.setIndirect(need[path].Indirect) - if need[path].Indirect && - (simplify || oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastDirectBlock) { - moveReq(r, lastIndirectBlock) - } else if !need[path].Indirect && - (simplify || oneFlatUncommentedBlock || lineToBlock[r.Syntax] == lastIndirectBlock) { - moveReq(r, lastDirectBlock) - } - } - - // Add new requirements. - for path, r := range need { - if have[path] == nil { - if r.Indirect { - moveReq(r, lastIndirectBlock) - } else { - moveReq(r, lastDirectBlock) - } - f.Require = append(f.Require, r) - } - } - - f.SortBlocks() -} - -func (f *File) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *File) DropRequire(path string) error { - for _, r := range f.Require { - if r.Mod.Path == path { - r.Syntax.markRemoved() - *r = Require{} - } - } - return nil -} - -// AddExclude adds an exclude statement to the mod file. Errors if the provided -// version is not a canonical version string -func (f *File) AddExclude(path, vers string) error { - if err := checkCanonicalVersion(path, vers); err != nil { - return err - } - - var hint *Line - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - return nil - } - if x.Mod.Path == path { - hint = x.Syntax - } - } - - f.Exclude = append(f.Exclude, &Exclude{Mod: module.Version{Path: path, Version: vers}, Syntax: f.Syntax.addLine(hint, "exclude", AutoQuote(path), vers)}) - return nil -} - -func (f *File) DropExclude(path, vers string) error { - for _, x := range f.Exclude { - if x.Mod.Path == path && x.Mod.Version == vers { - x.Syntax.markRemoved() - *x = Exclude{} - } - } - return nil -} - -func (f *File) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func addReplace(syntax *FileSyntax, replace *[]*Replace, oldPath, oldVers, newPath, newVers string) error { - need := true - old := module.Version{Path: oldPath, Version: oldVers} - new := module.Version{Path: newPath, Version: newVers} - tokens := []string{"replace", AutoQuote(oldPath)} - if oldVers != "" { - tokens = append(tokens, oldVers) - } - tokens = append(tokens, "=>", AutoQuote(newPath)) - if newVers != "" { - tokens = append(tokens, newVers) - } - - var hint *Line - for _, r := range *replace { - if r.Old.Path == oldPath && (oldVers == "" || r.Old.Version == oldVers) { - if need { - // Found replacement for old; update to use new. - r.New = new - syntax.updateLine(r.Syntax, tokens...) - need = false - continue - } - // Already added; delete other replacements for same. - r.Syntax.markRemoved() - *r = Replace{} - } - if r.Old.Path == oldPath { - hint = r.Syntax - } - } - if need { - *replace = append(*replace, &Replace{Old: old, New: new, Syntax: syntax.addLine(hint, tokens...)}) - } - return nil -} - -func (f *File) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -// AddRetract adds a retract statement to the mod file. Errors if the provided -// version interval does not consist of canonical version strings -func (f *File) AddRetract(vi VersionInterval, rationale string) error { - var path string - if f.Module != nil { - path = f.Module.Mod.Path - } - if err := checkCanonicalVersion(path, vi.High); err != nil { - return err - } - if err := checkCanonicalVersion(path, vi.Low); err != nil { - return err - } - - r := &Retract{ - VersionInterval: vi, - } - if vi.Low == vi.High { - r.Syntax = f.Syntax.addLine(nil, "retract", AutoQuote(vi.Low)) - } else { - r.Syntax = f.Syntax.addLine(nil, "retract", "[", AutoQuote(vi.Low), ",", AutoQuote(vi.High), "]") - } - if rationale != "" { - for line := range strings.SplitSeq(rationale, "\n") { - com := Comment{Token: "// " + line} - r.Syntax.Comment().Before = append(r.Syntax.Comment().Before, com) - } - } - return nil -} - -func (f *File) DropRetract(vi VersionInterval) error { - for _, r := range f.Retract { - if r.VersionInterval == vi { - r.Syntax.markRemoved() - *r = Retract{} - } - } - return nil -} - -// AddTool adds a new tool directive with the given path. -// It does nothing if the tool line already exists. -func (f *File) AddTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - return nil - } - } - - f.Tool = append(f.Tool, &Tool{ - Path: path, - Syntax: f.Syntax.addLine(nil, "tool", path), - }) - - f.SortBlocks() - return nil -} - -// DropTool removes a tool directive with the given path. -// It does nothing if no such tool directive exists. -func (f *File) DropTool(path string) error { - for _, t := range f.Tool { - if t.Path == path { - t.Syntax.markRemoved() - *t = Tool{} - } - } - return nil -} - -// AddIgnore adds a new ignore directive with the given path. -// It does nothing if the ignore line already exists. -func (f *File) AddIgnore(path string) error { - for _, t := range f.Ignore { - if t.Path == path { - return nil - } - } - - f.Ignore = append(f.Ignore, &Ignore{ - Path: path, - Syntax: f.Syntax.addLine(nil, "ignore", path), - }) - - f.SortBlocks() - return nil -} - -// DropIgnore removes an ignore directive with the given path. -// It does nothing if no such ignore directive exists. -func (f *File) DropIgnore(path string) error { - for _, t := range f.Ignore { - if t.Path == path { - t.Syntax.markRemoved() - *t = Ignore{} - } - } - return nil -} - -func (f *File) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - // semanticSortForExcludeVersionV is the Go version (plus leading "v") at which - // lines in exclude blocks start to use semantic sort instead of lexicographic sort. - // See go.dev/issue/60028. - const semanticSortForExcludeVersionV = "v1.21" - useSemanticSortForExclude := f.Go != nil && semver.Compare("v"+f.Go.Version, semanticSortForExcludeVersionV) >= 0 - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - less := compareLine - if block.Token[0] == "exclude" && useSemanticSortForExclude { - less = compareLineExclude - } else if block.Token[0] == "retract" { - less = compareLineRetract - } - slices.SortStableFunc(block.Line, less) - } -} - -// removeDups removes duplicate exclude, replace and tool directives. -// -// Earlier exclude and tool directives take priority. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *File) removeDups() { - removeDups(f.Syntax, &f.Exclude, &f.Replace, &f.Tool, &f.Ignore) -} - -func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace, tool *[]*Tool, ignore *[]*Ignore) { - kill := make(map[*Line]bool) - - // Remove duplicate excludes. - if exclude != nil { - haveExclude := make(map[module.Version]bool) - for _, x := range *exclude { - if haveExclude[x.Mod] { - kill[x.Syntax] = true - continue - } - haveExclude[x.Mod] = true - } - var excl []*Exclude - for _, x := range *exclude { - if !kill[x.Syntax] { - excl = append(excl, x) - } - } - *exclude = excl - } - - // Remove duplicate replacements. - // Later replacements take priority over earlier ones. - haveReplace := make(map[module.Version]bool) - for _, x := range slices.Backward(*replace) { - if haveReplace[x.Old] { - kill[x.Syntax] = true - continue - } - haveReplace[x.Old] = true - } - var repl []*Replace - for _, x := range *replace { - if !kill[x.Syntax] { - repl = append(repl, x) - } - } - *replace = repl - - if tool != nil { - haveTool := make(map[string]bool) - for _, t := range *tool { - if haveTool[t.Path] { - kill[t.Syntax] = true - continue - } - haveTool[t.Path] = true - } - var newTool []*Tool - for _, t := range *tool { - if !kill[t.Syntax] { - newTool = append(newTool, t) - } - } - *tool = newTool - } - - if ignore != nil { - haveIgnore := make(map[string]bool) - for _, i := range *ignore { - if haveIgnore[i.Path] { - kill[i.Syntax] = true - continue - } - haveIgnore[i.Path] = true - } - var newIgnore []*Ignore - for _, i := range *ignore { - if !kill[i.Syntax] { - newIgnore = append(newIgnore, i) - } - } - *ignore = newIgnore - } - - // Duplicate require and retract directives are not removed. - - // Drop killed statements from the syntax tree. - var stmts []Expr - for _, stmt := range syntax.Stmt { - switch stmt := stmt.(type) { - case *Line: - if kill[stmt] { - continue - } - case *LineBlock: - var lines []*Line - for _, line := range stmt.Line { - if !kill[line] { - lines = append(lines, line) - } - } - stmt.Line = lines - if len(lines) == 0 { - continue - } - } - stmts = append(stmts, stmt) - } - syntax.Stmt = stmts -} - -// compareLine compares li and lj. It sorts lexicographically without assigning -// any special meaning to tokens. -func compareLine(li, lj *Line) int { - for k := 0; k < len(li.Token) && k < len(lj.Token); k++ { - if li.Token[k] != lj.Token[k] { - return cmp.Compare(li.Token[k], lj.Token[k]) - } - } - return cmp.Compare(len(li.Token), len(lj.Token)) -} - -// compareLineExclude compares li and lj for lines in an "exclude" block. -func compareLineExclude(li, lj *Line) int { - if len(li.Token) != 2 || len(lj.Token) != 2 { - // Not a known exclude specification. - // Fall back to sorting lexicographically. - return compareLine(li, lj) - } - // An exclude specification has two tokens: ModulePath and Version. - // Compare module path by string order and version by semver rules. - if pi, pj := li.Token[0], lj.Token[0]; pi != pj { - return cmp.Compare(pi, pj) - } - return semver.Compare(li.Token[1], lj.Token[1]) -} - -// compareLineRetract compares li and lj for lines in a "retract" block. -// It treats each line as a version interval. Single versions are compared as -// if they were intervals with the same low and high version. -// Intervals are sorted in descending order, first by low version, then by -// high version, using [semver.Compare]. -func compareLineRetract(li, lj *Line) int { - interval := func(l *Line) VersionInterval { - if len(l.Token) == 1 { - return VersionInterval{Low: l.Token[0], High: l.Token[0]} - } else if len(l.Token) == 5 && l.Token[0] == "[" && l.Token[2] == "," && l.Token[4] == "]" { - return VersionInterval{Low: l.Token[1], High: l.Token[3]} - } else { - // Line in unknown format. Treat as an invalid version. - return VersionInterval{} - } - } - vii := interval(li) - vij := interval(lj) - if cmp := semver.Compare(vii.Low, vij.Low); cmp != 0 { - return -cmp - } - return -semver.Compare(vii.High, vij.High) -} - -// checkCanonicalVersion returns a non-nil error if vers is not a canonical -// version string or does not match the major version of path. -// -// If path is non-empty, the error text suggests a format with a major version -// corresponding to the path. -func checkCanonicalVersion(path, vers string) error { - _, pathMajor, pathMajorOk := module.SplitPathVersion(path) - - if vers == "" || vers != module.CanonicalVersion(vers) { - if pathMajor == "" { - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form v1.2.3"), - } - } - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("must be of the form %s.2.3", module.PathMajorPrefix(pathMajor)), - } - } - - if pathMajorOk { - if err := module.CheckPathMajor(vers, pathMajor); err != nil { - if pathMajor == "" { - // In this context, the user probably wrote "v2.3.4" when they meant - // "v2.3.4+incompatible". Suggest that instead of "v0 or v1". - return &module.InvalidVersionError{ - Version: vers, - Err: fmt.Errorf("should be %s+incompatible (or module %s/%v)", vers, path, semver.Major(vers)), - } - } - return err - } - } - - return nil -} diff --git a/vendor/golang.org/x/mod/modfile/work.go b/vendor/golang.org/x/mod/modfile/work.go deleted file mode 100644 index 92db618338d3..000000000000 --- a/vendor/golang.org/x/mod/modfile/work.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modfile - -import ( - "fmt" - "slices" - "strings" -) - -// A WorkFile is the parsed, interpreted form of a go.work file. -type WorkFile struct { - Go *Go - Toolchain *Toolchain - Godebug []*Godebug - Use []*Use - Replace []*Replace - - Syntax *FileSyntax -} - -// A Use is a single directory statement. -type Use struct { - Path string // Use path of module. - ModulePath string // Module path in the comment. - Syntax *Line -} - -// ParseWork parses and returns a go.work file. -// -// file is the name of the file, used in positions and errors. -// -// data is the content of the file. -// -// fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] -// must return the same string). -func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { - fs, err := parse(file, data) - if err != nil { - return nil, err - } - f := &WorkFile{ - Syntax: fs, - } - var errs ErrorList - - for _, x := range fs.Stmt { - switch x := x.(type) { - case *Line: - f.add(&errs, x, x.Token[0], x.Token[1:], fix) - - case *LineBlock: - if len(x.Token) > 1 { - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - } - switch x.Token[0] { - default: - errs = append(errs, Error{ - Filename: file, - Pos: x.Start, - Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), - }) - continue - case "godebug", "use", "replace": - for _, l := range x.Line { - f.add(&errs, l, x.Token[0], l.Token, fix) - } - } - } - } - - if len(errs) > 0 { - return nil, errs - } - return f, nil -} - -// Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like [WorkFile.DropUse] -// clear the entry but do not remove it from the slice. -// Cleanup cleans out all the cleared entries. -func (f *WorkFile) Cleanup() { - w := 0 - for _, r := range f.Use { - if r.Path != "" { - f.Use[w] = r - w++ - } - } - f.Use = f.Use[:w] - - w = 0 - for _, r := range f.Replace { - if r.Old.Path != "" { - f.Replace[w] = r - w++ - } - } - f.Replace = f.Replace[:w] - - f.Syntax.Cleanup() -} - -func (f *WorkFile) AddGoStmt(version string) error { - if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version %q", version) - } - if f.Go == nil { - stmt := &Line{Token: []string{"go", version}} - f.Go = &Go{ - Version: version, - Syntax: stmt, - } - // Find the first non-comment-only block and add - // the go statement before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Go.Version = version - f.Syntax.updateLine(f.Go.Syntax, "go", version) - } - return nil -} - -func (f *WorkFile) AddToolchainStmt(name string) error { - if !ToolchainRE.MatchString(name) { - return fmt.Errorf("invalid toolchain name %q", name) - } - if f.Toolchain == nil { - stmt := &Line{Token: []string{"toolchain", name}} - f.Toolchain = &Toolchain{ - Name: name, - Syntax: stmt, - } - // Find the go line and add the toolchain line after it. - // Or else find the first non-comment-only block and add - // the toolchain line before it. That will keep file comments at the top. - i := 0 - for i = 0; i < len(f.Syntax.Stmt); i++ { - if line, ok := f.Syntax.Stmt[i].(*Line); ok && len(line.Token) > 0 && line.Token[0] == "go" { - i++ - goto Found - } - } - for i = 0; i < len(f.Syntax.Stmt); i++ { - if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { - break - } - } - Found: - f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) - } else { - f.Toolchain.Name = name - f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) - } - return nil -} - -// DropGoStmt deletes the go statement from the file. -func (f *WorkFile) DropGoStmt() { - if f.Go != nil { - f.Go.Syntax.markRemoved() - f.Go = nil - } -} - -// DropToolchainStmt deletes the toolchain statement from the file. -func (f *WorkFile) DropToolchainStmt() { - if f.Toolchain != nil { - f.Toolchain.Syntax.markRemoved() - f.Toolchain = nil - } -} - -// AddGodebug sets the first godebug line for key to value, -// preserving any existing comments for that line and removing all -// other godebug lines for key. -// -// If no line currently exists for key, AddGodebug adds a new line -// at the end of the last godebug block. -func (f *WorkFile) AddGodebug(key, value string) error { - need := true - for _, g := range f.Godebug { - if g.Key == key { - if need { - g.Value = value - f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) - need = false - } else { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - } - - if need { - f.addNewGodebug(key, value) - } - return nil -} - -// addNewGodebug adds a new godebug key=value line at the end -// of the last godebug block, regardless of any existing godebug lines for key. -func (f *WorkFile) addNewGodebug(key, value string) { - line := f.Syntax.addLine(nil, "godebug", key+"="+value) - g := &Godebug{ - Key: key, - Value: value, - Syntax: line, - } - f.Godebug = append(f.Godebug, g) -} - -func (f *WorkFile) DropGodebug(key string) error { - for _, g := range f.Godebug { - if g.Key == key { - g.Syntax.markRemoved() - *g = Godebug{} - } - } - return nil -} - -func (f *WorkFile) AddUse(diskPath, modulePath string) error { - need := true - for _, d := range f.Use { - if d.Path == diskPath { - if need { - d.ModulePath = modulePath - f.Syntax.updateLine(d.Syntax, "use", AutoQuote(diskPath)) - need = false - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - } - - if need { - f.AddNewUse(diskPath, modulePath) - } - return nil -} - -func (f *WorkFile) AddNewUse(diskPath, modulePath string) { - line := f.Syntax.addLine(nil, "use", AutoQuote(diskPath)) - f.Use = append(f.Use, &Use{Path: diskPath, ModulePath: modulePath, Syntax: line}) -} - -func (f *WorkFile) SetUse(dirs []*Use) { - need := make(map[string]string) - for _, d := range dirs { - need[d.Path] = d.ModulePath - } - - for _, d := range f.Use { - if modulePath, ok := need[d.Path]; ok { - d.ModulePath = modulePath - } else { - d.Syntax.markRemoved() - *d = Use{} - } - } - - // TODO(#45713): Add module path to comment. - - for diskPath, modulePath := range need { - f.AddNewUse(diskPath, modulePath) - } - f.SortBlocks() -} - -func (f *WorkFile) DropUse(path string) error { - for _, d := range f.Use { - if d.Path == path { - d.Syntax.markRemoved() - *d = Use{} - } - } - return nil -} - -func (f *WorkFile) AddReplace(oldPath, oldVers, newPath, newVers string) error { - return addReplace(f.Syntax, &f.Replace, oldPath, oldVers, newPath, newVers) -} - -func (f *WorkFile) DropReplace(oldPath, oldVers string) error { - for _, r := range f.Replace { - if r.Old.Path == oldPath && r.Old.Version == oldVers { - r.Syntax.markRemoved() - *r = Replace{} - } - } - return nil -} - -func (f *WorkFile) SortBlocks() { - f.removeDups() // otherwise sorting is unsafe - - for _, stmt := range f.Syntax.Stmt { - block, ok := stmt.(*LineBlock) - if !ok { - continue - } - slices.SortStableFunc(block.Line, compareLine) - } -} - -// removeDups removes duplicate replace directives. -// -// Later replace directives take priority. -// -// require directives are not de-duplicated. That's left up to higher-level -// logic (MVS). -// -// retract directives are not de-duplicated since comments are -// meaningful, and versions may be retracted multiple times. -func (f *WorkFile) removeDups() { - removeDups(f.Syntax, nil, &f.Replace, nil, nil) -} diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go deleted file mode 100644 index 739c13f48fcc..000000000000 --- a/vendor/golang.org/x/mod/module/module.go +++ /dev/null @@ -1,840 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package module defines the module.Version type along with support code. -// -// The [module.Version] type is a simple Path, Version pair: -// -// type Version struct { -// Path string -// Version string -// } -// -// There are no restrictions imposed directly by use of this structure, -// but additional checking functions, most notably [Check], verify that -// a particular path, version pair is valid. -// -// # Escaped Paths -// -// Module paths appear as substrings of file system paths -// (in the download cache) and of web server URLs in the proxy protocol. -// In general we cannot rely on file systems to be case-sensitive, -// nor can we rely on web servers, since they read from file systems. -// That is, we cannot rely on the file system to keep rsc.io/QUOTE -// and rsc.io/quote separate. Windows and macOS don't. -// Instead, we must never require two different casings of a file path. -// Because we want the download cache to match the proxy protocol, -// and because we want the proxy protocol to be possible to serve -// from a tree of static files (which might be stored on a case-insensitive -// file system), the proxy protocol must never require two different casings -// of a URL path either. -// -// One possibility would be to make the escaped form be the lowercase -// hexadecimal encoding of the actual path bytes. This would avoid ever -// needing different casings of a file path, but it would be fairly illegible -// to most programmers when those paths appeared in the file system -// (including in file paths in compiler errors and stack traces) -// in web server logs, and so on. Instead, we want a safe escaped form that -// leaves most paths unaltered. -// -// The safe escaped form is to replace every uppercase letter -// with an exclamation mark followed by the letter's lowercase equivalent. -// -// For example, -// -// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go. -// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy -// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus. -// -// Import paths that avoid upper-case letters are left unchanged. -// Note that because import paths are ASCII-only and avoid various -// problematic punctuation (like : < and >), the escaped form is also ASCII-only -// and avoids the same problematic punctuation. -// -// Import paths have never allowed exclamation marks, so there is no -// need to define how to escape a literal !. -// -// # Unicode Restrictions -// -// Today, paths are disallowed from using Unicode. -// -// Although paths are currently disallowed from using Unicode, -// we would like at some point to allow Unicode letters as well, to assume that -// file systems and URLs are Unicode-safe (storing UTF-8), and apply -// the !-for-uppercase convention for escaping them in the file system. -// But there are at least two subtle considerations. -// -// First, note that not all case-fold equivalent distinct runes -// form an upper/lower pair. -// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin) -// are three distinct runes that case-fold to each other. -// When we do add Unicode letters, we must not assume that upper/lower -// are the only case-equivalent pairs. -// Perhaps the Kelvin symbol would be disallowed entirely, for example. -// Or perhaps it would escape as "!!k", or perhaps as "(212A)". -// -// Second, it would be nice to allow Unicode marks as well as letters, -// but marks include combining marks, and then we must deal not -// only with case folding but also normalization: both U+00E9 ('é') -// and U+0065 U+0301 ('e' followed by combining acute accent) -// look the same on the page and are treated by some file systems -// as the same path. If we do allow Unicode marks in paths, there -// must be some kind of normalization to allow only one canonical -// encoding of any character used in an import path. -package module - -// IMPORTANT NOTE -// -// This file essentially defines the set of valid import paths for the go command. -// There are many subtle considerations, including Unicode ambiguity, -// security, network, and file system representations. -// -// This file also defines the set of valid module path and version combinations, -// another topic with many subtle considerations. -// -// Changes to the semantics in this file require approval from rsc. - -import ( - "cmp" - "errors" - "fmt" - "path" - "slices" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/mod/semver" -) - -// A Version (for clients, a module.Version) is defined by a module path and version pair. -// These are stored in their plain (unescaped) form. -type Version struct { - // Path is a module path, like "golang.org/x/text" or "rsc.io/quote/v2". - Path string - - // Version is usually a semantic version in canonical form. - // There are three exceptions to this general rule. - // First, the top-level target of a build has no specific version - // and uses Version = "". - // Second, during MVS calculations the version "none" is used - // to represent the decision to take no version of a given module. - // Third, filesystem paths found in "replace" directives are - // represented by a path with an empty version. - Version string `json:",omitempty"` -} - -// String returns a representation of the Version suitable for logging -// (Path@Version, or just Path if Version is empty). -func (m Version) String() string { - if m.Version == "" { - return m.Path - } - return m.Path + "@" + m.Version -} - -// A ModuleError indicates an error specific to a module. -type ModuleError struct { - Path string - Version string - Err error -} - -// VersionError returns a [ModuleError] derived from a [Version] and error, -// or err itself if it is already such an error. -func VersionError(v Version, err error) error { - var mErr *ModuleError - if errors.As(err, &mErr) && mErr.Path == v.Path && mErr.Version == v.Version { - return err - } - return &ModuleError{ - Path: v.Path, - Version: v.Version, - Err: err, - } -} - -func (e *ModuleError) Error() string { - if v, ok := e.Err.(*InvalidVersionError); ok { - return fmt.Sprintf("%s@%s: invalid %s: %v", e.Path, v.Version, v.noun(), v.Err) - } - if e.Version != "" { - return fmt.Sprintf("%s@%s: %v", e.Path, e.Version, e.Err) - } - return fmt.Sprintf("module %s: %v", e.Path, e.Err) -} - -func (e *ModuleError) Unwrap() error { return e.Err } - -// An InvalidVersionError indicates an error specific to a version, with the -// module path unknown or specified externally. -// -// A [ModuleError] may wrap an InvalidVersionError, but an InvalidVersionError -// must not wrap a ModuleError. -type InvalidVersionError struct { - Version string - Pseudo bool - Err error -} - -// noun returns either "version" or "pseudo-version", depending on whether -// e.Version is a pseudo-version. -func (e *InvalidVersionError) noun() string { - if e.Pseudo { - return "pseudo-version" - } - return "version" -} - -func (e *InvalidVersionError) Error() string { - return fmt.Sprintf("%s %q invalid: %s", e.noun(), e.Version, e.Err) -} - -func (e *InvalidVersionError) Unwrap() error { return e.Err } - -// An InvalidPathError indicates a module, import, or file path doesn't -// satisfy all naming constraints. See [CheckPath], [CheckImportPath], -// and [CheckFilePath] for specific restrictions. -type InvalidPathError struct { - Kind string // "module", "import", or "file" - Path string - Err error -} - -func (e *InvalidPathError) Error() string { - return fmt.Sprintf("malformed %s path %q: %v", e.Kind, e.Path, e.Err) -} - -func (e *InvalidPathError) Unwrap() error { return e.Err } - -// Check checks that a given module path, version pair is valid. -// In addition to the path being a valid module path -// and the version being a valid semantic version, -// the two must correspond. -// For example, the path "yaml/v2" only corresponds to -// semantic versions beginning with "v2.". -func Check(path, version string) error { - if err := CheckPath(path); err != nil { - return err - } - if !semver.IsValid(version) { - return &ModuleError{ - Path: path, - Err: &InvalidVersionError{Version: version, Err: errors.New("not a semantic version")}, - } - } - _, pathMajor, _ := SplitPathVersion(path) - if err := CheckPathMajor(version, pathMajor); err != nil { - return &ModuleError{Path: path, Err: err} - } - return nil -} - -// firstPathOK reports whether r can appear in the first element of a module path. -// The first element of the path must be an LDH domain name, at least for now. -// To avoid case ambiguity, the domain name must be entirely lower case. -func firstPathOK(r rune) bool { - return r == '-' || r == '.' || - '0' <= r && r <= '9' || - 'a' <= r && r <= 'z' -} - -// modPathOK reports whether r can appear in a module path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// -// This matches what "go get" has historically recognized in import paths, -// and avoids confusing sequences like '%20' or '+' that would change meaning -// if used in a URL. -// -// TODO(rsc): We would like to allow Unicode letters, but that requires additional -// care in the safe encoding (see "escaped paths" above). -func modPathOK(r rune) bool { - if r < utf8.RuneSelf { - return r == '-' || r == '.' || r == '_' || r == '~' || - '0' <= r && r <= '9' || - 'A' <= r && r <= 'Z' || - 'a' <= r && r <= 'z' - } - return false -} - -// importPathOK reports whether r can appear in a package import path element. -// -// Import paths are intermediate between module paths and file paths: we -// disallow characters that would be confusing or ambiguous as arguments to -// 'go get' (such as '@' and ' ' ), but allow certain characters that are -// otherwise-unambiguous on the command line and historically used for some -// binary names (such as '++' as a suffix for compiler binaries and wrappers). -func importPathOK(r rune) bool { - return modPathOK(r) || r == '+' -} - -// fileNameOK reports whether r can appear in a file name. -// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. -// If we expand the set of allowed characters here, we have to -// work harder at detecting potential case-folding and normalization collisions. -// See note about "escaped paths" above. -func fileNameOK(r rune) bool { - if r < utf8.RuneSelf { - // Entire set of ASCII punctuation, from which we remove characters: - // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ - // We disallow some shell special characters: " ' * < > ? ` | - // (Note that some of those are disallowed by the Windows file system as well.) - // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). - // We allow spaces (U+0020) in file names. - const allowed = "!#$%&()+,-.=@[]^_{}~ " - if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { - return true - } - return strings.ContainsRune(allowed, r) - } - // It may be OK to add more ASCII punctuation here, but only carefully. - // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. - return unicode.IsLetter(r) -} - -// CheckPath checks that a module path is valid. -// A valid module path is a valid import path, as checked by [CheckImportPath], -// with three additional constraints. -// First, the leading path element (up to the first slash, if any), -// by convention a domain name, must contain only lower-case ASCII letters, -// ASCII digits, dots (U+002E), and dashes (U+002D); -// it must contain at least one dot and cannot start with a dash. -// Second, for a final path element of the form /vN, where N looks numeric -// (ASCII digits and dots) must not begin with a leading zero, must not be /v1, -// and must not contain any dots. For paths beginning with "gopkg.in/", -// this second requirement is replaced by a requirement that the path -// follow the gopkg.in server's conventions. -// Third, no path element may begin with a dot. -func CheckPath(path string) (err error) { - defer func() { - if err != nil { - err = &InvalidPathError{Kind: "module", Path: path, Err: err} - } - }() - - if err := checkPath(path, modulePath); err != nil { - return err - } - i := strings.Index(path, "/") - if i < 0 { - i = len(path) - } - if i == 0 { - return fmt.Errorf("leading slash") - } - if !strings.Contains(path[:i], ".") { - return fmt.Errorf("missing dot in first path element") - } - if path[0] == '-' { - return fmt.Errorf("leading dash in first path element") - } - for _, r := range path[:i] { - if !firstPathOK(r) { - return fmt.Errorf("invalid char %q in first path element", r) - } - } - if _, _, ok := SplitPathVersion(path); !ok { - return fmt.Errorf("invalid version") - } - return nil -} - -// CheckImportPath checks that an import path is valid. -// -// A valid import path consists of one or more valid path elements -// separated by slashes (U+002F). (It must not begin with nor end in a slash.) -// -// A valid path element is a non-empty string made up of -// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// It must not end with a dot (U+002E), nor contain two dots in a row. -// -// The element prefix up to the first dot must not be a reserved file name -// on Windows, regardless of case (CON, com1, NuL, and so on). The element -// must not have a suffix of a tilde followed by one or more ASCII digits -// (to exclude paths elements that look like Windows short-names). -// -// CheckImportPath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckImportPath(path string) error { - if err := checkPath(path, importPath); err != nil { - return &InvalidPathError{Kind: "import", Path: path, Err: err} - } - return nil -} - -// pathKind indicates what kind of path we're checking. Module paths, -// import paths, and file paths have different restrictions. -type pathKind int - -const ( - modulePath pathKind = iota - importPath - filePath -) - -// checkPath checks that a general path is valid. kind indicates what -// specific constraints should be applied. -// -// checkPath returns an error describing why the path is not valid. -// Because these checks apply to module, import, and file paths, -// and because other checks may be applied, the caller is expected to wrap -// this error with [InvalidPathError]. -func checkPath(path string, kind pathKind) error { - if !utf8.ValidString(path) { - return fmt.Errorf("invalid UTF-8") - } - if path == "" { - return fmt.Errorf("empty string") - } - if path[0] == '-' && kind != filePath { - return fmt.Errorf("leading dash") - } - if strings.Contains(path, "//") { - return fmt.Errorf("double slash") - } - if path[len(path)-1] == '/' { - return fmt.Errorf("trailing slash") - } - elemStart := 0 - for i, r := range path { - if r == '/' { - if err := checkElem(path[elemStart:i], kind); err != nil { - return err - } - elemStart = i + 1 - } - } - if err := checkElem(path[elemStart:], kind); err != nil { - return err - } - return nil -} - -// checkElem checks whether an individual path element is valid. -func checkElem(elem string, kind pathKind) error { - if elem == "" { - return fmt.Errorf("empty path element") - } - if strings.Count(elem, ".") == len(elem) { - return fmt.Errorf("invalid path element %q", elem) - } - if elem[0] == '.' && kind == modulePath { - return fmt.Errorf("leading dot in path element") - } - if elem[len(elem)-1] == '.' { - return fmt.Errorf("trailing dot in path element") - } - for _, r := range elem { - ok := false - switch kind { - case modulePath: - ok = modPathOK(r) - case importPath: - ok = importPathOK(r) - case filePath: - ok = fileNameOK(r) - default: - panic(fmt.Sprintf("internal error: invalid kind %v", kind)) - } - if !ok { - return fmt.Errorf("invalid char %q", r) - } - } - - // Windows disallows a bunch of path elements, sadly. - // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file - short := elem - if i := strings.Index(short, "."); i >= 0 { - short = short[:i] - } - for _, bad := range badWindowsNames { - if strings.EqualFold(bad, short) { - return fmt.Errorf("%q disallowed as path element component on Windows", short) - } - } - - if kind == filePath { - // don't check for Windows short-names in file names. They're - // only an issue for import paths. - return nil - } - - // Reject path components that look like Windows short-names. - // Those usually end in a tilde followed by one or more ASCII digits. - if tilde := strings.LastIndexByte(short, '~'); tilde >= 0 && tilde < len(short)-1 { - suffix := short[tilde+1:] - suffixIsDigits := true - for _, r := range suffix { - if r < '0' || r > '9' { - suffixIsDigits = false - break - } - } - if suffixIsDigits { - return fmt.Errorf("trailing tilde and digits in path element") - } - } - - return nil -} - -// CheckFilePath checks that a slash-separated file path is valid. -// The definition of a valid file path is the same as the definition -// of a valid import path except that the set of allowed characters is larger: -// all Unicode letters, ASCII digits, the ASCII space character (U+0020), -// and the ASCII punctuation characters -// “!#$%&()+,-.=@[]^_{}~”. -// (The excluded punctuation characters, " * < > ? ` ' | / \ and :, -// have special meanings in certain shells or operating systems.) -// -// CheckFilePath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckFilePath(path string) error { - if err := checkPath(path, filePath); err != nil { - return &InvalidPathError{Kind: "file", Path: path, Err: err} - } - return nil -} - -// badWindowsNames are the reserved file path elements on Windows. -// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file -var badWindowsNames = []string{ - "CON", - "PRN", - "AUX", - "NUL", - "COM1", - "COM2", - "COM3", - "COM4", - "COM5", - "COM6", - "COM7", - "COM8", - "COM9", - "LPT1", - "LPT2", - "LPT3", - "LPT4", - "LPT5", - "LPT6", - "LPT7", - "LPT8", - "LPT9", -} - -// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path -// and version is either empty or "/vN" for N >= 2. -// As a special case, gopkg.in paths are recognized directly; -// they require ".vN" instead of "/vN", and for all N, not just N >= 2. -// SplitPathVersion returns with ok = false when presented with -// a path whose last path element does not satisfy the constraints -// applied by [CheckPath], such as "example.com/pkg/v1" or "example.com/pkg/v1.2". -func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { - if strings.HasPrefix(path, "gopkg.in/") { - return splitGopkgIn(path) - } - - i := len(path) - dot := false - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') { - if path[i-1] == '.' { - dot = true - } - i-- - } - if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { - return path, "", true - } - prefix, pathMajor = path[:i-2], path[i-2:] - if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" { - return path, "", false - } - return prefix, pathMajor, true -} - -// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths. -func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { - if !strings.HasPrefix(path, "gopkg.in/") { - return path, "", false - } - i := len(path) - if strings.HasSuffix(path, "-unstable") { - i -= len("-unstable") - } - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') { - i-- - } - if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' { - // All gopkg.in paths must end in vN for some N. - return path, "", false - } - prefix, pathMajor = path[:i-2], path[i-2:] - if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" { - return path, "", false - } - return prefix, pathMajor, true -} - -// MatchPathMajor reports whether the semantic version v -// matches the path major version pathMajor. -// -// MatchPathMajor returns true if and only if [CheckPathMajor] returns nil. -func MatchPathMajor(v, pathMajor string) bool { - return CheckPathMajor(v, pathMajor) == nil -} - -// CheckPathMajor returns a non-nil error if the semantic version v -// does not match the path major version pathMajor. -func CheckPathMajor(v, pathMajor string) error { - // TODO(jayconrod): return errors or panic for invalid inputs. This function - // (and others) was covered by integration tests for cmd/go, and surrounding - // code protected against invalid inputs like non-canonical versions. - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" { - // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1. - // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405. - return nil - } - m := semver.Major(v) - if pathMajor == "" { - if m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" { - return nil - } - pathMajor = "v0 or v1" - } else if pathMajor[0] == '/' || pathMajor[0] == '.' { - if m == pathMajor[1:] { - return nil - } - pathMajor = pathMajor[1:] - } - return &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("should be %s, not %s", pathMajor, semver.Major(v)), - } -} - -// PathMajorPrefix returns the major-version tag prefix implied by pathMajor. -// An empty PathMajorPrefix allows either v0 or v1. -// -// Note that [MatchPathMajor] may accept some versions that do not actually begin -// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1' -// pathMajor, even though that pathMajor implies 'v1' tagging. -func PathMajorPrefix(pathMajor string) string { - if pathMajor == "" { - return "" - } - if pathMajor[0] != '/' && pathMajor[0] != '.' { - panic("pathMajor suffix " + pathMajor + " passed to PathMajorPrefix lacks separator") - } - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - m := pathMajor[1:] - if m != semver.Major(m) { - panic("pathMajor suffix " + pathMajor + "passed to PathMajorPrefix is not a valid major version") - } - return m -} - -// CanonicalVersion returns the canonical form of the version string v. -// It is the same as [semver.Canonical] except that it preserves the special build suffix "+incompatible". -func CanonicalVersion(v string) string { - cv := semver.Canonical(v) - if semver.Build(v) == "+incompatible" { - cv += "+incompatible" - } - return cv -} - -// Sort sorts the list by Path, breaking ties by comparing [Version] fields. -// The Version fields are interpreted as semantic versions (using [semver.Compare]) -// optionally followed by a tie-breaking suffix introduced by a slash character, -// like in "v0.0.1/go.mod". -func Sort(list []Version) { - slices.SortFunc(list, func(i, j Version) int { - if i.Path != j.Path { - return strings.Compare(i.Path, j.Path) - } - // To help go.sum formatting, allow version/file. - // Compare semver prefix by semver rules, - // file by string order. - vi := i.Version - vj := j.Version - var fi, fj string - if k := strings.Index(vi, "/"); k >= 0 { - vi, fi = vi[:k], vi[k:] - } - if k := strings.Index(vj, "/"); k >= 0 { - vj, fj = vj[:k], vj[k:] - } - if vi != vj { - return semver.Compare(vi, vj) - } - return cmp.Compare(fi, fj) - }) -} - -// EscapePath returns the escaped form of the given module path. -// It fails if the module path is invalid. -func EscapePath(path string) (escaped string, err error) { - if err := CheckPath(path); err != nil { - return "", err - } - - return escapeString(path) -} - -// EscapeVersion returns the escaped form of the given module version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func EscapeVersion(v string) (escaped string, err error) { - if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") { - return "", &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("disallowed version string"), - } - } - return escapeString(v) -} - -func escapeString(s string) (escaped string, err error) { - haveUpper := false - for _, r := range s { - if r == '!' || r >= utf8.RuneSelf { - // This should be disallowed by CheckPath, but diagnose anyway. - // The correctness of the escaping loop below depends on it. - return "", fmt.Errorf("internal error: inconsistency in EscapePath") - } - if 'A' <= r && r <= 'Z' { - haveUpper = true - } - } - - if !haveUpper { - return s, nil - } - - var buf []byte - for _, r := range s { - if 'A' <= r && r <= 'Z' { - buf = append(buf, '!', byte(r+'a'-'A')) - } else { - buf = append(buf, byte(r)) - } - } - return string(buf), nil -} - -// UnescapePath returns the module path for the given escaped path. -// It fails if the escaped path is invalid or describes an invalid path. -func UnescapePath(escaped string) (path string, err error) { - path, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped module path %q", escaped) - } - if err := CheckPath(path); err != nil { - return "", fmt.Errorf("invalid escaped module path %q: %v", escaped, err) - } - return path, nil -} - -// UnescapeVersion returns the version string for the given escaped version. -// It fails if the escaped form is invalid or describes an invalid version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func UnescapeVersion(escaped string) (v string, err error) { - v, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped version %q", escaped) - } - if err := checkElem(v, filePath); err != nil { - return "", fmt.Errorf("invalid escaped version %q: %v", v, err) - } - return v, nil -} - -func unescapeString(escaped string) (string, bool) { - var buf []byte - - bang := false - for _, r := range escaped { - if r >= utf8.RuneSelf { - return "", false - } - if bang { - bang = false - if r < 'a' || 'z' < r { - return "", false - } - buf = append(buf, byte(r+'A'-'a')) - continue - } - if r == '!' { - bang = true - continue - } - if 'A' <= r && r <= 'Z' { - return "", false - } - buf = append(buf, byte(r)) - } - if bang { - return "", false - } - return string(buf), true -} - -// MatchPrefixPatterns reports whether any path prefix of target matches one of -// the glob patterns (as defined by [path.Match]) in the comma-separated globs -// list. This implements the algorithm used when matching a module path to the -// GOPRIVATE environment variable, as described by 'go help module-private'. -// -// It ignores any empty or malformed patterns in the list. -// Trailing slashes on patterns are ignored. -func MatchPrefixPatterns(globs, target string) bool { - for globs != "" { - // Extract next non-empty glob in comma-separated list. - var glob string - if before, after, ok := strings.Cut(globs, ","); ok { - glob, globs = before, after - } else { - glob, globs = globs, "" - } - glob = strings.TrimSuffix(glob, "/") - if glob == "" { - continue - } - - // A glob with N+1 path elements (N slashes) needs to be matched - // against the first N+1 path elements of target, - // which end just before the N+1'th slash. - n := strings.Count(glob, "/") - prefix := target - // Walk target, counting slashes, truncating at the N+1'th slash. - for i := 0; i < len(target); i++ { - if target[i] == '/' { - if n == 0 { - prefix = target[:i] - break - } - n-- - } - } - if n > 0 { - // Not enough prefix elements. - continue - } - matched, _ := path.Match(glob, prefix) - if matched { - return true - } - } - return false -} diff --git a/vendor/golang.org/x/mod/module/pseudo.go b/vendor/golang.org/x/mod/module/pseudo.go deleted file mode 100644 index 9cf19d3254eb..000000000000 --- a/vendor/golang.org/x/mod/module/pseudo.go +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Pseudo-versions -// -// Code authors are expected to tag the revisions they want users to use, -// including prereleases. However, not all authors tag versions at all, -// and not all commits a user might want to try will have tags. -// A pseudo-version is a version with a special form that allows us to -// address an untagged commit and order that version with respect to -// other versions we might encounter. -// -// A pseudo-version takes one of the general forms: -// -// (1) vX.0.0-yyyymmddhhmmss-abcdef123456 -// (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 -// (3) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible -// (4) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 -// (5) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible -// -// If there is no recently tagged version with the right major version vX, -// then form (1) is used, creating a space of pseudo-versions at the bottom -// of the vX version range, less than any tagged version, including the unlikely v0.0.0. -// -// If the most recent tagged version before the target commit is vX.Y.Z or vX.Y.Z+incompatible, -// then the pseudo-version uses form (2) or (3), making it a prerelease for the next -// possible semantic version after vX.Y.Z. The leading 0 segment in the prerelease string -// ensures that the pseudo-version compares less than possible future explicit prereleases -// like vX.Y.(Z+1)-rc1 or vX.Y.(Z+1)-1. -// -// If the most recent tagged version before the target commit is vX.Y.Z-pre or vX.Y.Z-pre+incompatible, -// then the pseudo-version uses form (4) or (5), making it a slightly later prerelease. - -package module - -import ( - "errors" - "fmt" - "strings" - "time" - - "golang.org/x/mod/internal/lazyregexp" - "golang.org/x/mod/semver" -) - -var pseudoVersionRE = lazyregexp.New(`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$`) - -const PseudoVersionTimestampFormat = "20060102150405" - -// PseudoVersion returns a pseudo-version for the given major version ("v1") -// preexisting older tagged version ("" or "v1.2.3" or "v1.2.3-pre"), revision time, -// and revision identifier (usually a 12-byte commit hash prefix). -func PseudoVersion(major, older string, t time.Time, rev string) string { - if major == "" { - major = "v0" - } - segment := fmt.Sprintf("%s-%s", t.UTC().Format(PseudoVersionTimestampFormat), rev) - build := semver.Build(older) - older = semver.Canonical(older) - if older == "" { - return major + ".0.0-" + segment // form (1) - } - if semver.Prerelease(older) != "" { - return older + ".0." + segment + build // form (4), (5) - } - - // Form (2), (3). - // Extract patch from vMAJOR.MINOR.PATCH - i := strings.LastIndex(older, ".") + 1 - v, patch := older[:i], older[i:] - - // Reassemble. - return v + incDecimal(patch) + "-0." + segment + build -} - -// ZeroPseudoVersion returns a pseudo-version with a zero timestamp and -// revision, which may be used as a placeholder. -func ZeroPseudoVersion(major string) string { - return PseudoVersion(major, "", time.Time{}, "000000000000") -} - -// incDecimal returns the decimal string incremented by 1. -func incDecimal(decimal string) string { - // Scan right to left turning 9s to 0s until you find a digit to increment. - digits := []byte(decimal) - i := len(digits) - 1 - for ; i >= 0 && digits[i] == '9'; i-- { - digits[i] = '0' - } - if i >= 0 { - digits[i]++ - } else { - // digits is all zeros - digits[0] = '1' - digits = append(digits, '0') - } - return string(digits) -} - -// decDecimal returns the decimal string decremented by 1, or the empty string -// if the decimal is all zeroes. -func decDecimal(decimal string) string { - // Scan right to left turning 0s to 9s until you find a digit to decrement. - digits := []byte(decimal) - i := len(digits) - 1 - for ; i >= 0 && digits[i] == '0'; i-- { - digits[i] = '9' - } - if i < 0 { - // decimal is all zeros - return "" - } - if i == 0 && digits[i] == '1' && len(digits) > 1 { - digits = digits[1:] - } else { - digits[i]-- - } - return string(digits) -} - -// IsPseudoVersion reports whether v is a pseudo-version. -func IsPseudoVersion(v string) bool { - return strings.Count(v, "-") >= 2 && semver.IsValid(v) && pseudoVersionRE.MatchString(v) -} - -// IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base, -// timestamp, and revision, as returned by [ZeroPseudoVersion]. -func IsZeroPseudoVersion(v string) bool { - return v == ZeroPseudoVersion(semver.Major(v)) -} - -// PseudoVersionTime returns the time stamp of the pseudo-version v. -// It returns an error if v is not a pseudo-version or if the time stamp -// embedded in the pseudo-version is not a valid time. -func PseudoVersionTime(v string) (time.Time, error) { - _, timestamp, _, _, err := parsePseudoVersion(v) - if err != nil { - return time.Time{}, err - } - t, err := time.Parse("20060102150405", timestamp) - if err != nil { - return time.Time{}, &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("malformed time %q", timestamp), - } - } - return t, nil -} - -// PseudoVersionRev returns the revision identifier of the pseudo-version v. -// It returns an error if v is not a pseudo-version. -func PseudoVersionRev(v string) (rev string, err error) { - _, _, rev, _, err = parsePseudoVersion(v) - return -} - -// PseudoVersionBase returns the canonical parent version, if any, upon which -// the pseudo-version v is based. -// -// If v has no parent version (that is, if it is "vX.0.0-[…]"), -// PseudoVersionBase returns the empty string and a nil error. -func PseudoVersionBase(v string) (string, error) { - base, _, _, build, err := parsePseudoVersion(v) - if err != nil { - return "", err - } - - switch pre := semver.Prerelease(base); pre { - case "": - // vX.0.0-yyyymmddhhmmss-abcdef123456 → "" - if build != "" { - // Pseudo-versions of the form vX.0.0-yyyymmddhhmmss-abcdef123456+incompatible - // are nonsensical: the "vX.0.0-" prefix implies that there is no parent tag, - // but the "+incompatible" suffix implies that the major version of - // the parent tag is not compatible with the module's import path. - // - // There are a few such entries in the index generated by proxy.golang.org, - // but we believe those entries were generated by the proxy itself. - return "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("lacks base version, but has build metadata %q", build), - } - } - return "", nil - - case "-0": - // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z - // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z+incompatible - base = strings.TrimSuffix(base, pre) - i := strings.LastIndexByte(base, '.') - if i < 0 { - panic("base from parsePseudoVersion missing patch number: " + base) - } - patch := decDecimal(base[i+1:]) - if patch == "" { - // vX.0.0-0 is invalid, but has been observed in the wild in the index - // generated by requests to proxy.golang.org. - // - // NOTE(bcmills): I cannot find a historical bug that accounts for - // pseudo-versions of this form, nor have I seen such versions in any - // actual go.mod files. If we find actual examples of this form and a - // reasonable theory of how they came into existence, it seems fine to - // treat them as equivalent to vX.0.0 (especially since the invalid - // pseudo-versions have lower precedence than the real ones). For now, we - // reject them. - return "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("version before %s would have negative patch number", base), - } - } - return base[:i+1] + patch + build, nil - - default: - // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z-pre - // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z-pre+incompatible - if !strings.HasSuffix(base, ".0") { - panic(`base from parsePseudoVersion missing ".0" before date: ` + base) - } - return strings.TrimSuffix(base, ".0") + build, nil - } -} - -var errPseudoSyntax = errors.New("syntax error") - -func parsePseudoVersion(v string) (base, timestamp, rev, build string, err error) { - if !IsPseudoVersion(v) { - return "", "", "", "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: errPseudoSyntax, - } - } - build = semver.Build(v) - v = strings.TrimSuffix(v, build) - j := strings.LastIndex(v, "-") - v, rev = v[:j], v[j+1:] - i := strings.LastIndex(v, "-") - if j := strings.LastIndex(v, "."); j > i { - base = v[:j] // "vX.Y.Z-pre.0" or "vX.Y.(Z+1)-0" - timestamp = v[j+1:] - } else { - base = v[:i] // "vX.0.0" - timestamp = v[i+1:] - } - return base, timestamp, rev, build, nil -} diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go deleted file mode 100644 index 824b282c8308..000000000000 --- a/vendor/golang.org/x/mod/semver/semver.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package semver implements comparison of semantic version strings. -// In this package, semantic version strings must begin with a leading "v", -// as in "v1.0.0". -// -// The general form of a semantic version string accepted by this package is -// -// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] -// -// where square brackets indicate optional parts of the syntax; -// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; -// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers -// using only alphanumeric characters and hyphens; and -// all-numeric PRERELEASE identifiers must not have leading zeros. -// -// This package follows Semantic Versioning 2.0.0 (see semver.org) -// with two exceptions. First, it requires the "v" prefix. Second, it recognizes -// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) -// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. -package semver - -import ( - "slices" - "strings" -) - -// parsed returns the parsed form of a semantic version string. -type parsed struct { - major string - minor string - patch string - short string - prerelease string - build string -} - -// IsValid reports whether v is a valid semantic version string. -func IsValid(v string) bool { - _, ok := parse(v) - return ok -} - -// Canonical returns the canonical formatting of the semantic version v. -// It fills in any missing .MINOR or .PATCH and discards build metadata. -// Two semantic versions compare equal only if their canonical formatting -// is an identical string. -// The canonical invalid semantic version is the empty string. -func Canonical(v string) string { - p, ok := parse(v) - if !ok { - return "" - } - if p.build != "" { - return v[:len(v)-len(p.build)] - } - if p.short != "" { - return v + p.short - } - return v -} - -// Major returns the major version prefix of the semantic version v. -// For example, Major("v2.1.0") == "v2". -// If v is an invalid semantic version string, Major returns the empty string. -func Major(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return v[:1+len(pv.major)] -} - -// MajorMinor returns the major.minor version prefix of the semantic version v. -// For example, MajorMinor("v2.1.0") == "v2.1". -// If v is an invalid semantic version string, MajorMinor returns the empty string. -func MajorMinor(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - i := 1 + len(pv.major) - if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { - return v[:j] - } - return v[:i] + "." + pv.minor -} - -// Prerelease returns the prerelease suffix of the semantic version v. -// For example, Prerelease("v2.1.0-pre+meta") == "-pre". -// If v is an invalid semantic version string, Prerelease returns the empty string. -func Prerelease(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.prerelease -} - -// Build returns the build suffix of the semantic version v. -// For example, Build("v2.1.0+meta") == "+meta". -// If v is an invalid semantic version string, Build returns the empty string. -func Build(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.build -} - -// Compare returns an integer comparing two versions according to -// semantic version precedence. -// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. -// -// An invalid semantic version string is considered less than a valid one. -// All invalid semantic version strings compare equal to each other. -func Compare(v, w string) int { - pv, ok1 := parse(v) - pw, ok2 := parse(w) - if !ok1 && !ok2 { - return 0 - } - if !ok1 { - return -1 - } - if !ok2 { - return +1 - } - if c := compareInt(pv.major, pw.major); c != 0 { - return c - } - if c := compareInt(pv.minor, pw.minor); c != 0 { - return c - } - if c := compareInt(pv.patch, pw.patch); c != 0 { - return c - } - return comparePrerelease(pv.prerelease, pw.prerelease) -} - -// Max canonicalizes its arguments and then returns the version string -// that compares greater. -// -// Deprecated: use [Compare] instead. In most cases, returning a canonicalized -// version is not expected or desired. -func Max(v, w string) string { - v = Canonical(v) - w = Canonical(w) - if Compare(v, w) > 0 { - return v - } - return w -} - -// ByVersion implements [sort.Interface] for sorting semantic version strings. -type ByVersion []string - -func (vs ByVersion) Len() int { return len(vs) } -func (vs ByVersion) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] } -func (vs ByVersion) Less(i, j int) bool { return compareVersion(vs[i], vs[j]) < 0 } - -// Sort sorts a list of semantic version strings using [Compare] and falls back -// to use [strings.Compare] if both versions are considered equal. -func Sort(list []string) { - slices.SortFunc(list, compareVersion) -} - -func compareVersion(a, b string) int { - cmp := Compare(a, b) - if cmp != 0 { - return cmp - } - return strings.Compare(a, b) -} - -func parse(v string) (p parsed, ok bool) { - if v == "" || v[0] != 'v' { - return - } - p.major, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.minor = "0" - p.patch = "0" - p.short = ".0.0" - return - } - if v[0] != '.' { - ok = false - return - } - p.minor, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.patch = "0" - p.short = ".0" - return - } - if v[0] != '.' { - ok = false - return - } - p.patch, v, ok = parseInt(v[1:]) - if !ok { - return - } - if len(v) > 0 && v[0] == '-' { - p.prerelease, v, ok = parsePrerelease(v) - if !ok { - return - } - } - if len(v) > 0 && v[0] == '+' { - p.build, v, ok = parseBuild(v) - if !ok { - return - } - } - if v != "" { - ok = false - return - } - ok = true - return -} - -func parseInt(v string) (t, rest string, ok bool) { - if v == "" { - return - } - if v[0] < '0' || '9' < v[0] { - return - } - i := 1 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - if v[0] == '0' && i != 1 { - return - } - return v[:i], v[i:], true -} - -func parsePrerelease(v string) (t, rest string, ok bool) { - // "A pre-release version MAY be denoted by appending a hyphen and - // a series of dot separated identifiers immediately following the patch version. - // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. - // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." - if v == "" || v[0] != '-' { - return - } - i := 1 - start := 1 - for i < len(v) && v[i] != '+' { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i || isBadNum(v[start:i]) { - return - } - start = i + 1 - } - i++ - } - if start == i || isBadNum(v[start:i]) { - return - } - return v[:i], v[i:], true -} - -func parseBuild(v string) (t, rest string, ok bool) { - if v == "" || v[0] != '+' { - return - } - i := 1 - start := 1 - for i < len(v) { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i { - return - } - start = i + 1 - } - i++ - } - if start == i { - return - } - return v[:i], v[i:], true -} - -func isIdentChar(c byte) bool { - return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' -} - -func isBadNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) && i > 1 && v[0] == '0' -} - -func isNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) -} - -func compareInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} - -func comparePrerelease(x, y string) int { - // "When major, minor, and patch are equal, a pre-release version has - // lower precedence than a normal version. - // Example: 1.0.0-alpha < 1.0.0. - // Precedence for two pre-release versions with the same major, minor, - // and patch version MUST be determined by comparing each dot separated - // identifier from left to right until a difference is found as follows: - // identifiers consisting of only digits are compared numerically and - // identifiers with letters or hyphens are compared lexically in ASCII - // sort order. Numeric identifiers always have lower precedence than - // non-numeric identifiers. A larger set of pre-release fields has a - // higher precedence than a smaller set, if all of the preceding - // identifiers are equal. - // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < - // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." - if x == y { - return 0 - } - if x == "" { - return +1 - } - if y == "" { - return -1 - } - for x != "" && y != "" { - x = x[1:] // skip - or . - y = y[1:] // skip - or . - var dx, dy string - dx, x = nextIdent(x) - dy, y = nextIdent(y) - if dx != dy { - ix := isNum(dx) - iy := isNum(dy) - if ix != iy { - if ix { - return -1 - } else { - return +1 - } - } - if ix { - if len(dx) < len(dy) { - return -1 - } - if len(dx) > len(dy) { - return +1 - } - } - if dx < dy { - return -1 - } else { - return +1 - } - } - } - if x == "" { - return -1 - } else { - return +1 - } -} - -func nextIdent(x string) (dx, rest string) { - i := 0 - for i < len(x) && x[i] != '.' { - i++ - } - return x[:i], x[i:] -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c9f32360ea70..c9110af1150c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -391,12 +391,6 @@ go.opentelemetry.io/proto/otlp/trace/v1 # go.yaml.in/yaml/v3 v3.0.5 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/mod v0.41.0 -## explicit; go 1.26.0 -golang.org/x/mod/internal/lazyregexp -golang.org/x/mod/modfile -golang.org/x/mod/module -golang.org/x/mod/semver # golang.org/x/net v0.60.0 ## explicit; go 1.26.0 golang.org/x/net/http/httpguts From 090f05d8c37bea3ac1a95e482138adaebe862969 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Sat, 12 Sep 2026 01:21:18 +0900 Subject: [PATCH 2/5] cmd/docker-trust: stop importing the root module's internal packages The "docker-trust" plugin lives in a nested module, and reaches into the root module's "internal/" packages. That works today because its module path ("github.com/docker/cli/cmd/docker-trust") is a prefix match for "github.com/docker/cli/internal/...". Once the root module gains a major-version suffix, the internal path becomes "github.com/docker/cli/v29/internal/...", which the nested module is no longer allowed to import ("use of internal package ... not allowed"). Folding the plugin back into the root module is not an option: notary and its dependencies pull in ~45 additional modules (MySQL, SQLite, bugsnag, gorm, ...) which is exactly why it was split out. So copy the four small helpers it uses into the plugin's own internal tree instead. Assisted-by: Claude Opus 5 Signed-off-by: Akihiro Suda --- .../internal/commands/commands.go | 39 ++++++ .../internal/jsonstream/display.go | 69 ++++++++++ .../internal/lazyregexp/lazyregexp.go | 98 ++++++++++++++ cmd/docker-trust/internal/prompt/prompt.go | 126 ++++++++++++++++++ cmd/docker-trust/internal/test/cmd.go | 2 +- cmd/docker-trust/internal/trust/trust_push.go | 2 +- cmd/docker-trust/trust/cmd.go | 2 +- cmd/docker-trust/trust/key_generate.go | 2 +- cmd/docker-trust/trust/revoke.go | 2 +- cmd/docker-trust/trust/signer_add.go | 2 +- cmd/docker-trust/trust/signer_remove.go | 2 +- 11 files changed, 339 insertions(+), 7 deletions(-) create mode 100644 cmd/docker-trust/internal/commands/commands.go create mode 100644 cmd/docker-trust/internal/jsonstream/display.go create mode 100644 cmd/docker-trust/internal/lazyregexp/lazyregexp.go create mode 100644 cmd/docker-trust/internal/prompt/prompt.go diff --git a/cmd/docker-trust/internal/commands/commands.go b/cmd/docker-trust/internal/commands/commands.go new file mode 100644 index 000000000000..2a1750625c09 --- /dev/null +++ b/cmd/docker-trust/internal/commands/commands.go @@ -0,0 +1,39 @@ +package commands + +import ( + "os" + + "github.com/docker/cli/cli/command" + "github.com/spf13/cobra" +) + +var commands []func(command.Cli) *cobra.Command + +// Register pushes the passed in command into an internal queue which can +// be retrieved using the [Commands] function. It is designed to be called +// in an init function and is not safe for concurrent use. +func Register(f func(command.Cli) *cobra.Command) { + commands = append(commands, f) +} + +// RegisterLegacy functions similarly to [Register], but it checks the +// "DOCKER_HIDE_LEGACY_COMMANDS" environment variable and if it has been +// set and is non-empty, the command will be hidden. It is designed to be called +// in an init function and is not safe for concurrent use. +func RegisterLegacy(f func(command.Cli) *cobra.Command) { + commands = append(commands, func(c command.Cli) *cobra.Command { + if os.Getenv("DOCKER_HIDE_LEGACY_COMMANDS") == "" { + return f(c) + } + cmd := f(c) + cmd.Hidden = true + cmd.Aliases = []string{} + return cmd + }) +} + +// Commands returns the internal queue holding registered commands added +// via [Register] and [RegisterLegacy]. +func Commands() []func(command.Cli) *cobra.Command { + return commands +} diff --git a/cmd/docker-trust/internal/jsonstream/display.go b/cmd/docker-trust/internal/jsonstream/display.go new file mode 100644 index 000000000000..de9d1e2cbcc2 --- /dev/null +++ b/cmd/docker-trust/internal/jsonstream/display.go @@ -0,0 +1,69 @@ +package jsonstream + +import ( + "context" + "io" + + "github.com/docker/cli/cli/streams" + "github.com/moby/moby/api/types/jsonstream" + "github.com/moby/moby/client/pkg/jsonmessage" +) + +type ( + JSONError = jsonstream.Error + JSONMessage = jsonstream.Message + JSONProgress = jsonstream.Progress +) + +type ctxReader struct { + err chan error + r io.Reader +} + +func (r *ctxReader) Read(p []byte) (n int, err error) { + select { + case err = <-r.err: + return 0, err + default: + return r.r.Read(p) + } +} + +type Options func(*options) + +type options struct { + AuxCallback func(JSONMessage) +} + +func WithAuxCallback(cb func(JSONMessage)) Options { + return func(o *options) { + o.AuxCallback = cb + } +} + +// Display prints the JSON messages from the given reader to the given stream. +// +// It wraps the [jsonmessage.DisplayJSONMessagesStream] function to make it +// "context aware" and appropriately returns why the function was canceled. +// +// It returns an error if the context is canceled, but not if the input reader / stream is closed. +func Display(ctx context.Context, in io.Reader, stream *streams.Out, opts ...Options) error { + if ctx.Err() != nil { + return ctx.Err() + } + + reader := &ctxReader{err: make(chan error, 1), r: in} + stopFunc := context.AfterFunc(ctx, func() { reader.err <- ctx.Err() }) + defer stopFunc() + + o := options{} + for _, opt := range opts { + opt(&o) + } + + if err := jsonmessage.DisplayJSONMessagesStream(reader, stream, stream.FD(), stream.IsTerminal(), o.AuxCallback); err != nil { + return err + } + + return ctx.Err() +} diff --git a/cmd/docker-trust/internal/lazyregexp/lazyregexp.go b/cmd/docker-trust/internal/lazyregexp/lazyregexp.go new file mode 100644 index 000000000000..62e29c55d060 --- /dev/null +++ b/cmd/docker-trust/internal/lazyregexp/lazyregexp.go @@ -0,0 +1,98 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code below was largely copied from golang.org/x/mod@v0.22; +// https://github.com/golang/mod/blob/v0.22.0/internal/lazyregexp/lazyre.go +// with some additional methods added. + +// Package lazyregexp is a thin wrapper over regexp, allowing the use of global +// regexp variables without forcing them to be compiled at init. +package lazyregexp + +import ( + "os" + "regexp" + "strings" + "sync" +) + +// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be +// compiled the first time it is needed. +type Regexp struct { + str string + once sync.Once + rx *regexp.Regexp +} + +func (r *Regexp) re() *regexp.Regexp { + r.once.Do(r.build) + return r.rx +} + +func (r *Regexp) build() { + r.rx = regexp.MustCompile(r.str) + r.str = "" +} + +func (r *Regexp) FindSubmatch(s []byte) [][]byte { + return r.re().FindSubmatch(s) +} + +func (r *Regexp) FindAllStringSubmatch(s string, n int) [][]string { + return r.re().FindAllStringSubmatch(s, n) +} + +func (r *Regexp) FindStringSubmatch(s string) []string { + return r.re().FindStringSubmatch(s) +} + +func (r *Regexp) FindStringSubmatchIndex(s string) []int { + return r.re().FindStringSubmatchIndex(s) +} + +func (r *Regexp) ReplaceAllString(src, repl string) string { + return r.re().ReplaceAllString(src, repl) +} + +func (r *Regexp) FindString(s string) string { + return r.re().FindString(s) +} + +func (r *Regexp) FindAllString(s string, n int) []string { + return r.re().FindAllString(s, n) +} + +func (r *Regexp) MatchString(s string) bool { + return r.re().MatchString(s) +} + +func (r *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string { + return r.re().ReplaceAllStringFunc(src, repl) +} + +func (r *Regexp) ReplaceAllLiteralString(src, repl string) string { + return r.re().ReplaceAllLiteralString(src, repl) +} + +func (r *Regexp) String() string { + return r.re().String() +} + +func (r *Regexp) SubexpNames() []string { + return r.re().SubexpNames() +} + +var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") + +// New creates a new lazy regexp, delaying the compiling work until it is first +// needed. If the code is being run as part of tests, the regexp compiling will +// happen immediately. +func New(str string) *Regexp { + lr := &Regexp{str: str} + if inTest { + // In tests, always compile the regexps early. + lr.re() + } + return lr +} diff --git a/cmd/docker-trust/internal/prompt/prompt.go b/cmd/docker-trust/internal/prompt/prompt.go new file mode 100644 index 000000000000..58b6bbc17587 --- /dev/null +++ b/cmd/docker-trust/internal/prompt/prompt.go @@ -0,0 +1,126 @@ +// Package prompt provides utilities to prompt the user for input. + +package prompt + +import ( + "bufio" + "context" + "io" + "os" + "runtime" + "strings" + + "github.com/docker/cli/cli/streams" + "github.com/moby/term" +) + +const ErrTerminated cancelledErr = "prompt terminated" + +type cancelledErr string + +func (e cancelledErr) Error() string { + return string(e) +} + +func (cancelledErr) Cancelled() {} + +// DisableInputEcho disables input echo on the provided streams.In. +// This is useful when the user provides sensitive information like passwords. +// The function returns a restore function that should be called to restore the +// terminal state. +// +// TODO(thaJeztah): implement without depending on streams? +func DisableInputEcho(ins *streams.In) (restore func() error, _ error) { + oldState, err := term.SaveState(ins.FD()) + if err != nil { + return nil, err + } + restore = func() error { + return term.RestoreTerminal(ins.FD(), oldState) + } + return restore, term.DisableEcho(ins.FD(), oldState) +} + +// ReadInput requests input from the user. +// +// It returns an empty string ("") with an [ErrTerminated] if the user terminates +// the CLI with SIGINT or SIGTERM while the prompt is active. If the prompt +// returns an error, the caller should close the [io.Reader] used for the prompt +// and propagate the error up the stack to prevent the background goroutine +// from blocking indefinitely. +func ReadInput(ctx context.Context, in io.Reader, out io.Writer, message string) (string, error) { + _, _ = out.Write([]byte(message)) + + result := make(chan string) + go func() { + scanner := bufio.NewScanner(in) + if scanner.Scan() { + result <- strings.TrimSpace(scanner.Text()) + } + }() + + select { + case <-ctx.Done(): + _, _ = out.Write([]byte("\n")) + return "", ErrTerminated + case r := <-result: + return r, nil + } +} + +// Confirm requests and checks confirmation from the user. +// +// It displays the provided message followed by "[y/N]". If the user +// input 'y' or 'Y' it returns true otherwise false. If no message is provided, +// "Are you sure you want to proceed? [y/N] " will be used instead. +// +// It returns false with an [ErrTerminated] if the user terminates +// the CLI with SIGINT or SIGTERM while the prompt is active. If the prompt +// returns an error, the caller should close the [io.Reader] used for the prompt +// and propagate the error up the stack to prevent the background goroutine +// from blocking indefinitely. +func Confirm(ctx context.Context, in io.Reader, out io.Writer, message string) (bool, error) { + if message == "" { + message = "Are you sure you want to proceed?" + } + message += " [y/N] " + + _, _ = out.Write([]byte(message)) + + // On Windows, force the use of the regular OS stdin stream. + // + // StdStreams() may wrap stdin with windowsconsole.NewAnsiReader to + // emulate VT input on consoles that do not support it natively, but + // that wrapper has historically caused interactive prompts to hang + // or behave incorrectly. + // + // See: + // - https://github.com/moby/moby/issues/14336 + // - https://github.com/moby/moby/issues/14210 + // - https://github.com/moby/moby/pull/17738 + if runtime.GOOS == "windows" { + in = os.Stdin + } + + result := make(chan bool) + + go func() { + var res bool + scanner := bufio.NewScanner(in) + if scanner.Scan() { + answer := strings.TrimSpace(scanner.Text()) + if strings.EqualFold(answer, "y") { + res = true + } + } + result <- res + }() + + select { + case <-ctx.Done(): + _, _ = out.Write([]byte("\n")) + return false, ErrTerminated + case r := <-result: + return r, nil + } +} diff --git a/cmd/docker-trust/internal/test/cmd.go b/cmd/docker-trust/internal/test/cmd.go index 8b98d2df623b..ec9a1b4abc26 100644 --- a/cmd/docker-trust/internal/test/cmd.go +++ b/cmd/docker-trust/internal/test/cmd.go @@ -7,7 +7,7 @@ import ( "time" "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/prompt" + "github.com/docker/cli/cmd/docker-trust/internal/prompt" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/cmd/docker-trust/internal/trust/trust_push.go b/cmd/docker-trust/internal/trust/trust_push.go index c65085f2c81c..7a3f893c90ff 100644 --- a/cmd/docker-trust/internal/trust/trust_push.go +++ b/cmd/docker-trust/internal/trust/trust_push.go @@ -11,7 +11,7 @@ import ( "github.com/distribution/reference" "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/cmd/docker-trust/internal/jsonstream" registrytypes "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" "github.com/theupdateframework/notary/client" diff --git a/cmd/docker-trust/trust/cmd.go b/cmd/docker-trust/trust/cmd.go index 55c80fe68a97..40f7a1d9bbed 100644 --- a/cmd/docker-trust/trust/cmd.go +++ b/cmd/docker-trust/trust/cmd.go @@ -3,7 +3,7 @@ package trust import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/cmd/docker-trust/internal/commands" "github.com/spf13/cobra" ) diff --git a/cmd/docker-trust/trust/key_generate.go b/cmd/docker-trust/trust/key_generate.go index cf42ffc9bc96..8640f53ea77b 100644 --- a/cmd/docker-trust/trust/key_generate.go +++ b/cmd/docker-trust/trust/key_generate.go @@ -9,8 +9,8 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" + "github.com/docker/cli/cmd/docker-trust/internal/lazyregexp" "github.com/docker/cli/cmd/docker-trust/internal/trust" - "github.com/docker/cli/internal/lazyregexp" "github.com/spf13/cobra" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/trustmanager" diff --git a/cmd/docker-trust/trust/revoke.go b/cmd/docker-trust/trust/revoke.go index b005d341b5a8..9bff3abf2c8d 100644 --- a/cmd/docker-trust/trust/revoke.go +++ b/cmd/docker-trust/trust/revoke.go @@ -7,8 +7,8 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" + "github.com/docker/cli/cmd/docker-trust/internal/prompt" "github.com/docker/cli/cmd/docker-trust/internal/trust" - "github.com/docker/cli/internal/prompt" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" diff --git a/cmd/docker-trust/trust/signer_add.go b/cmd/docker-trust/trust/signer_add.go index 0d94b9c46fcd..1ba91c243fde 100644 --- a/cmd/docker-trust/trust/signer_add.go +++ b/cmd/docker-trust/trust/signer_add.go @@ -11,8 +11,8 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" + "github.com/docker/cli/cmd/docker-trust/internal/lazyregexp" "github.com/docker/cli/cmd/docker-trust/internal/trust" - "github.com/docker/cli/internal/lazyregexp" "github.com/docker/cli/opts" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" diff --git a/cmd/docker-trust/trust/signer_remove.go b/cmd/docker-trust/trust/signer_remove.go index e920ec645550..206066262088 100644 --- a/cmd/docker-trust/trust/signer_remove.go +++ b/cmd/docker-trust/trust/signer_remove.go @@ -8,8 +8,8 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" + "github.com/docker/cli/cmd/docker-trust/internal/prompt" "github.com/docker/cli/cmd/docker-trust/internal/trust" - "github.com/docker/cli/internal/prompt" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" From 8358771d26276404fd39be1c712e5101e2a0d153 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 12 Sep 2026 01:24:05 +0900 Subject: [PATCH 3/5] update import paths to v29 Go modules require a major-version suffix in the module path for major versions >= 2, so the module becomes "github.com/docker/cli/v29" and all import paths are updated accordingly. Note that this means the import paths have to be updated on every major (CalVer) bump of the CLI. Signed-off-by: CrazyMax Assisted-by: Claude Opus 5 Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 2 +- README.md | 2 +- TESTING.md | 2 +- cli-plugins/examples/helloworld/main.go | 6 +-- cli-plugins/hooks/hooks_utils_test.go | 2 +- cli-plugins/hooks/printer_test.go | 2 +- cli-plugins/hooks/template_test.go | 2 +- cli-plugins/manager/candidate.go | 2 +- cli-plugins/manager/candidate_test.go | 2 +- cli-plugins/manager/cobra.go | 4 +- cli-plugins/manager/cobra_test.go | 2 +- cli-plugins/manager/hooks.go | 6 +-- cli-plugins/manager/hooks_test.go | 2 +- cli-plugins/manager/manager.go | 8 ++-- cli-plugins/manager/manager_test.go | 6 +-- cli-plugins/manager/plugin.go | 4 +- cli-plugins/manager/telemetry.go | 2 +- cli-plugins/plugin/plugin.go | 12 +++--- cli/cobra.go | 6 +-- cli/cobra_test.go | 2 +- cli/command/builder/cmd.go | 8 ++-- cli/command/builder/prune.go | 10 ++--- cli/command/builder/prune_test.go | 2 +- cli/command/checkpoint/cmd.go | 6 +-- cli/command/checkpoint/create.go | 4 +- cli/command/checkpoint/create_test.go | 2 +- cli/command/checkpoint/formatter.go | 2 +- cli/command/checkpoint/formatter_test.go | 2 +- cli/command/checkpoint/list.go | 8 ++-- cli/command/checkpoint/list_test.go | 2 +- cli/command/checkpoint/remove.go | 4 +- cli/command/checkpoint/remove_test.go | 2 +- cli/command/cli.go | 20 +++++----- cli/command/cli_options.go | 2 +- cli/command/cli_test.go | 8 ++-- cli/command/commands/commands.go | 38 +++++++++---------- cli/command/config/cmd.go | 8 ++-- cli/command/config/create.go | 6 +-- cli/command/config/create_test.go | 2 +- cli/command/config/formatter.go | 4 +- cli/command/config/formatter_test.go | 2 +- cli/command/config/inspect.go | 8 ++-- cli/command/config/inspect_test.go | 4 +- cli/command/config/ls.go | 10 ++--- cli/command/config/ls_test.go | 6 +-- cli/command/config/remove.go | 4 +- cli/command/config/remove_test.go | 2 +- cli/command/container/attach.go | 6 +-- cli/command/container/attach_test.go | 4 +- cli/command/container/auth_config_utils.go | 6 +-- cli/command/container/cmd.go | 6 +-- cli/command/container/commit.go | 8 ++-- cli/command/container/commit_test.go | 2 +- cli/command/container/completion.go | 2 +- cli/command/container/completion_test.go | 4 +- cli/command/container/cp.go | 6 +-- cli/command/container/cp_test.go | 2 +- cli/command/container/create.go | 16 ++++---- cli/command/container/create_test.go | 6 +-- cli/command/container/diff.go | 8 ++-- cli/command/container/diff_test.go | 2 +- cli/command/container/exec.go | 10 ++--- cli/command/container/exec_test.go | 8 ++-- cli/command/container/export.go | 6 +-- cli/command/container/export_test.go | 2 +- cli/command/container/formatter_diff.go | 2 +- cli/command/container/formatter_diff_test.go | 2 +- cli/command/container/formatter_stats.go | 2 +- cli/command/container/formatter_stats_test.go | 2 +- cli/command/container/hijack.go | 2 +- cli/command/container/inspect.go | 10 ++--- cli/command/container/kill.go | 6 +-- cli/command/container/kill_test.go | 2 +- cli/command/container/list.go | 12 +++--- cli/command/container/list_test.go | 8 ++-- cli/command/container/logs.go | 6 +-- cli/command/container/logs_test.go | 2 +- cli/command/container/opts.go | 6 +-- cli/command/container/pause.go | 6 +-- cli/command/container/pause_test.go | 2 +- cli/command/container/port.go | 6 +-- cli/command/container/port_test.go | 2 +- cli/command/container/prune.go | 10 ++--- cli/command/container/prune_test.go | 2 +- cli/command/container/rename.go | 6 +-- cli/command/container/restart.go | 6 +-- cli/command/container/restart_test.go | 2 +- cli/command/container/rm.go | 6 +-- cli/command/container/rm_test.go | 2 +- cli/command/container/run.go | 8 ++-- cli/command/container/run_test.go | 6 +-- cli/command/container/start.go | 6 +-- cli/command/container/start_test.go | 2 +- cli/command/container/stats.go | 10 ++--- cli/command/container/stop.go | 6 +-- cli/command/container/stop_test.go | 2 +- cli/command/container/top.go | 8 ++-- cli/command/container/tty.go | 2 +- cli/command/container/tty_test.go | 4 +- cli/command/container/unpause.go | 6 +-- cli/command/container/update.go | 8 ++-- cli/command/container/wait.go | 6 +-- cli/command/context.go | 2 +- cli/command/context/cmd.go | 6 +-- cli/command/context/completion.go | 2 +- cli/command/context/completion_test.go | 2 +- cli/command/context/create.go | 10 ++--- cli/command/context/create_test.go | 10 ++--- cli/command/context/export-import_test.go | 4 +- cli/command/context/export.go | 6 +-- cli/command/context/import.go | 8 ++-- cli/command/context/inspect.go | 8 ++-- cli/command/context/list.go | 10 ++--- cli/command/context/list_test.go | 4 +- cli/command/context/options.go | 6 +-- cli/command/context/remove.go | 4 +- cli/command/context/remove_test.go | 4 +- cli/command/context/show.go | 4 +- cli/command/context/update.go | 10 ++--- cli/command/context/update_test.go | 4 +- cli/command/context/use.go | 4 +- cli/command/context/use_test.go | 8 ++-- cli/command/defaultcontextstore.go | 6 +-- cli/command/defaultcontextstore_test.go | 8 ++-- cli/command/formatter/container_test.go | 2 +- cli/command/formatter/formatter.go | 4 +- cli/command/formatter/image_test.go | 2 +- cli/command/formatter/volume_test.go | 2 +- cli/command/idresolver/idresolver_test.go | 2 +- cli/command/image/build.go | 14 +++---- cli/command/image/build/context.go | 2 +- cli/command/image/build/context_detect.go | 2 +- .../image/build/internal/urlutil/urlutil.go | 2 +- cli/command/image/build_test.go | 4 +- cli/command/image/cmd.go | 6 +-- cli/command/image/formatter_history.go | 2 +- cli/command/image/formatter_history_test.go | 4 +- cli/command/image/history.go | 10 ++--- cli/command/image/history_test.go | 2 +- cli/command/image/import.go | 10 ++--- cli/command/image/import_test.go | 2 +- cli/command/image/inspect.go | 10 ++--- cli/command/image/inspect_test.go | 2 +- cli/command/image/list.go | 12 +++--- cli/command/image/list_test.go | 4 +- cli/command/image/load.go | 8 ++-- cli/command/image/load_test.go | 2 +- cli/command/image/prune.go | 10 ++--- cli/command/image/prune_test.go | 4 +- cli/command/image/pull.go | 10 ++--- cli/command/image/pull_test.go | 2 +- cli/command/image/push.go | 12 +++--- cli/command/image/push_test.go | 2 +- cli/command/image/remove.go | 6 +-- cli/command/image/remove_test.go | 2 +- cli/command/image/save.go | 6 +-- cli/command/image/save_test.go | 2 +- cli/command/image/tag.go | 6 +-- cli/command/image/tag_test.go | 2 +- cli/command/image/tree.go | 6 +-- cli/command/image/tree_test.go | 2 +- cli/command/inspect/inspector.go | 4 +- cli/command/inspect/inspector_test.go | 2 +- cli/command/manifest/annotate.go | 10 ++--- cli/command/manifest/annotate_test.go | 4 +- cli/command/manifest/client_test.go | 4 +- cli/command/manifest/cmd.go | 6 +-- cli/command/manifest/create_list.go | 4 +- cli/command/manifest/create_test.go | 6 +-- cli/command/manifest/inspect.go | 6 +-- cli/command/manifest/inspect_test.go | 6 +-- cli/command/manifest/push.go | 8 ++-- cli/command/manifest/push_test.go | 6 +-- cli/command/manifest/rm.go | 6 +-- cli/command/manifest/rm_test.go | 4 +- cli/command/manifest/util.go | 4 +- cli/command/network/cmd.go | 6 +-- cli/command/network/connect.go | 8 ++-- cli/command/network/connect_test.go | 2 +- cli/command/network/create.go | 6 +-- cli/command/network/create_test.go | 2 +- cli/command/network/disconnect.go | 6 +-- cli/command/network/disconnect_test.go | 2 +- cli/command/network/formatter.go | 2 +- cli/command/network/formatter_test.go | 4 +- cli/command/network/inspect.go | 10 ++--- cli/command/network/list.go | 10 ++--- cli/command/network/list_test.go | 4 +- cli/command/network/prune.go | 10 ++--- cli/command/network/prune_test.go | 2 +- cli/command/network/remove.go | 8 ++-- cli/command/network/remove_test.go | 2 +- cli/command/node/cmd.go | 6 +-- cli/command/node/completion.go | 2 +- cli/command/node/completion_test.go | 2 +- cli/command/node/demote.go | 4 +- cli/command/node/demote_test.go | 4 +- cli/command/node/formatter.go | 4 +- cli/command/node/formatter_test.go | 4 +- cli/command/node/inspect.go | 8 ++-- cli/command/node/inspect_test.go | 4 +- cli/command/node/list.go | 10 ++--- cli/command/node/list_test.go | 6 +-- cli/command/node/opts.go | 2 +- cli/command/node/promote.go | 4 +- cli/command/node/promote_test.go | 4 +- cli/command/node/ps.go | 10 ++--- cli/command/node/ps_test.go | 4 +- cli/command/node/remove.go | 4 +- cli/command/node/remove_test.go | 2 +- cli/command/node/update.go | 8 ++-- cli/command/node/update_test.go | 4 +- cli/command/plugin/cmd.go | 6 +-- cli/command/plugin/completion.go | 2 +- cli/command/plugin/create.go | 4 +- cli/command/plugin/create_test.go | 2 +- cli/command/plugin/disable.go | 4 +- cli/command/plugin/disable_test.go | 2 +- cli/command/plugin/enable.go | 4 +- cli/command/plugin/enable_test.go | 2 +- cli/command/plugin/formatter.go | 2 +- cli/command/plugin/formatter_test.go | 4 +- cli/command/plugin/inspect.go | 8 ++-- cli/command/plugin/inspect_test.go | 2 +- cli/command/plugin/install.go | 8 ++-- cli/command/plugin/install_test.go | 2 +- cli/command/plugin/list.go | 10 ++--- cli/command/plugin/list_test.go | 2 +- cli/command/plugin/push.go | 6 +-- cli/command/plugin/remove.go | 4 +- cli/command/plugin/remove_test.go | 2 +- cli/command/plugin/set.go | 4 +- cli/command/plugin/upgrade.go | 8 ++-- cli/command/plugin/upgrade_test.go | 2 +- cli/command/registry.go | 14 +++---- cli/command/registry/formatter_search.go | 2 +- cli/command/registry/formatter_search_test.go | 2 +- cli/command/registry/login.go | 16 ++++---- cli/command/registry/login_test.go | 12 +++--- cli/command/registry/logout.go | 12 +++--- cli/command/registry/search.go | 10 ++--- cli/command/registry/warning.go | 6 +-- cli/command/registry_test.go | 6 +-- cli/command/secret/cmd.go | 8 ++-- cli/command/secret/create.go | 6 +-- cli/command/secret/create_test.go | 2 +- cli/command/secret/formatter.go | 4 +- cli/command/secret/formatter_test.go | 2 +- cli/command/secret/inspect.go | 8 ++-- cli/command/secret/inspect_test.go | 4 +- cli/command/secret/ls.go | 10 ++--- cli/command/secret/ls_test.go | 6 +-- cli/command/secret/remove.go | 4 +- cli/command/secret/remove_test.go | 2 +- cli/command/service/client_test.go | 2 +- cli/command/service/cmd.go | 6 +-- cli/command/service/completion.go | 2 +- cli/command/service/completion_test.go | 4 +- cli/command/service/create.go | 8 ++-- cli/command/service/create_test.go | 2 +- cli/command/service/formatter.go | 4 +- cli/command/service/formatter_test.go | 2 +- cli/command/service/generic_resource_opts.go | 2 +- cli/command/service/helpers.go | 6 +-- cli/command/service/inspect.go | 8 ++-- cli/command/service/inspect_test.go | 2 +- cli/command/service/list.go | 10 ++--- cli/command/service/list_test.go | 4 +- cli/command/service/logs.go | 10 ++--- cli/command/service/opts.go | 4 +- cli/command/service/opts_test.go | 2 +- cli/command/service/progress/progress.go | 2 +- cli/command/service/ps.go | 12 +++--- cli/command/service/ps_test.go | 4 +- cli/command/service/remove.go | 4 +- cli/command/service/rollback.go | 4 +- cli/command/service/rollback_test.go | 2 +- cli/command/service/scale.go | 4 +- cli/command/service/update.go | 10 ++--- cli/command/stack/client_test.go | 2 +- cli/command/stack/cmd.go | 8 ++-- cli/command/stack/common.go | 4 +- cli/command/stack/config.go | 8 ++-- cli/command/stack/config_test.go | 6 +-- cli/command/stack/deploy.go | 8 ++-- cli/command/stack/deploy_composefile.go | 8 ++-- cli/command/stack/deploy_composefile_test.go | 2 +- cli/command/stack/deploy_test.go | 4 +- cli/command/stack/list.go | 8 ++-- cli/command/stack/list_formatter.go | 2 +- cli/command/stack/list_formatter_test.go | 2 +- cli/command/stack/list_test.go | 4 +- cli/command/stack/list_utils.go | 2 +- cli/command/stack/loader.go | 8 ++-- cli/command/stack/ps.go | 12 +++--- cli/command/stack/ps_test.go | 6 +-- cli/command/stack/remove.go | 4 +- cli/command/stack/remove_test.go | 2 +- cli/command/stack/services.go | 12 +++--- cli/command/stack/services_test.go | 6 +-- cli/command/swarm/ca.go | 8 ++-- cli/command/swarm/ca_test.go | 2 +- cli/command/swarm/cmd.go | 6 +-- cli/command/swarm/init.go | 4 +- cli/command/swarm/init_test.go | 2 +- cli/command/swarm/join.go | 4 +- cli/command/swarm/join_test.go | 2 +- cli/command/swarm/join_token.go | 4 +- cli/command/swarm/join_token_test.go | 4 +- cli/command/swarm/leave.go | 4 +- cli/command/swarm/leave_test.go | 2 +- cli/command/swarm/opts.go | 2 +- cli/command/swarm/unlock.go | 6 +-- cli/command/swarm/unlock_key.go | 4 +- cli/command/swarm/unlock_key_test.go | 4 +- cli/command/swarm/unlock_test.go | 4 +- cli/command/swarm/update.go | 4 +- cli/command/swarm/update_test.go | 4 +- cli/command/system/cmd.go | 6 +-- cli/command/system/completion.go | 4 +- cli/command/system/completion_test.go | 4 +- cli/command/system/df.go | 8 ++-- cli/command/system/dial_stdio.go | 4 +- cli/command/system/events.go | 12 +++--- cli/command/system/events_test.go | 2 +- cli/command/system/info.go | 18 ++++----- cli/command/system/info_test.go | 6 +-- cli/command/system/inspect.go | 10 ++--- cli/command/system/inspect_test.go | 2 +- cli/command/system/prune.go | 10 ++--- cli/command/system/prune_test.go | 14 +++---- cli/command/system/pruner/pruner.go | 4 +- cli/command/system/version.go | 14 +++---- cli/command/system/version_test.go | 2 +- cli/command/task/formatter.go | 2 +- cli/command/task/formatter_test.go | 2 +- cli/command/task/print.go | 8 ++-- cli/command/task/print_test.go | 8 ++-- cli/command/telemetry_utils.go | 2 +- cli/command/telemetry_utils_test.go | 2 +- cli/command/utils.go | 2 +- cli/command/utils_test.go | 2 +- cli/command/volume/cmd.go | 6 +-- cli/command/volume/create.go | 6 +-- cli/command/volume/create_test.go | 2 +- cli/command/volume/inspect.go | 10 ++--- cli/command/volume/inspect_test.go | 4 +- cli/command/volume/list.go | 10 ++--- cli/command/volume/list_test.go | 6 +-- cli/command/volume/prune.go | 10 ++--- cli/command/volume/prune_test.go | 4 +- cli/command/volume/remove.go | 6 +-- cli/command/volume/remove_test.go | 2 +- cli/command/volume/update.go | 6 +-- cli/command/volume/update_test.go | 2 +- cli/compose/convert/compose.go | 2 +- cli/compose/convert/compose_test.go | 2 +- cli/compose/convert/service.go | 6 +-- cli/compose/convert/service_test.go | 2 +- cli/compose/convert/volume.go | 2 +- cli/compose/convert/volume_test.go | 2 +- cli/compose/interpolation/interpolation.go | 2 +- cli/compose/loader/envfile.go | 2 +- cli/compose/loader/full-struct_test.go | 2 +- cli/compose/loader/interpolate.go | 2 +- cli/compose/loader/loader.go | 14 +++---- cli/compose/loader/loader_test.go | 2 +- cli/compose/loader/merge.go | 2 +- cli/compose/loader/merge_test.go | 2 +- cli/compose/template/template.go | 2 +- cli/compose/types/types.go | 2 +- cli/config/config.go | 6 +-- cli/config/config_test.go | 4 +- cli/config/configfile/file.go | 6 +-- cli/config/configfile/file_test.go | 4 +- cli/config/credentials/credentials.go | 2 +- cli/config/credentials/file_store.go | 2 +- cli/config/credentials/file_store_test.go | 2 +- cli/config/credentials/native_store.go | 2 +- cli/config/credentials/native_store_test.go | 2 +- cli/config/memorystore/store.go | 4 +- cli/config/memorystore/store_test.go | 2 +- cli/connhelper/connhelper.go | 4 +- cli/connhelper/ssh/ssh.go | 2 +- cli/context/docker/load.go | 6 +-- cli/context/tlsdata.go | 2 +- cli/flags/options.go | 2 +- cli/flags/options_test.go | 2 +- cli/manifest/store/store.go | 2 +- cli/manifest/store/store_test.go | 2 +- cmd/docker-trust/go.mod | 14 ++++--- cmd/docker-trust/go.sum | 22 +++++------ .../internal/commands/commands.go | 2 +- .../internal/jsonstream/display.go | 2 +- cmd/docker-trust/internal/prompt/prompt.go | 2 +- cmd/docker-trust/internal/test/cli.go | 6 +-- cmd/docker-trust/internal/test/cmd.go | 2 +- cmd/docker-trust/internal/trust/trust.go | 2 +- cmd/docker-trust/internal/trust/trust_push.go | 4 +- cmd/docker-trust/main.go | 8 ++-- cmd/docker-trust/trust/cmd.go | 4 +- cmd/docker-trust/trust/commands.go | 10 ++--- cmd/docker-trust/trust/common.go | 6 +-- cmd/docker-trust/trust/formatter.go | 2 +- cmd/docker-trust/trust/formatter_test.go | 2 +- cmd/docker-trust/trust/inspect.go | 6 +-- cmd/docker-trust/trust/inspect_pretty.go | 4 +- cmd/docker-trust/trust/key.go | 4 +- cmd/docker-trust/trust/key_generate.go | 4 +- cmd/docker-trust/trust/key_generate_test.go | 2 +- cmd/docker-trust/trust/key_load.go | 4 +- cmd/docker-trust/trust/key_load_test.go | 2 +- cmd/docker-trust/trust/revoke.go | 4 +- cmd/docker-trust/trust/sign.go | 4 +- cmd/docker-trust/trust/sign_test.go | 2 +- cmd/docker-trust/trust/signer.go | 4 +- cmd/docker-trust/trust/signer_add.go | 6 +-- cmd/docker-trust/trust/signer_add_test.go | 2 +- cmd/docker-trust/trust/signer_remove.go | 4 +- cmd/docker/aliases.go | 4 +- cmd/docker/builder.go | 6 +-- cmd/docker/builder_test.go | 8 ++-- cmd/docker/cloud.go | 12 +++--- cmd/docker/cloud_test.go | 12 +++--- cmd/docker/completions.go | 2 +- cmd/docker/completions_test.go | 2 +- cmd/docker/docker.go | 18 ++++----- cmd/docker/docker_test.go | 10 ++--- cmd/docker/docker_windows_386.go | 2 +- cmd/docker/docker_windows_amd64.go | 2 +- cmd/docker/docker_windows_arm.go | 2 +- cmd/docker/docker_windows_arm64.go | 2 +- docs/generate/generate.go | 6 +-- e2e/cli-plugins/config_test.go | 2 +- e2e/cli-plugins/dial_test.go | 2 +- e2e/cli-plugins/main_test.go | 2 +- e2e/cli-plugins/plugins/badmeta/main.go | 2 +- .../plugins/nopersistentprerun/main.go | 6 +-- e2e/cli-plugins/plugins/presocket/main.go | 6 +-- e2e/cli-plugins/util_test.go | 4 +- e2e/container/attach_test.go | 2 +- e2e/container/create_test.go | 2 +- e2e/container/kill_test.go | 2 +- e2e/container/main_test.go | 2 +- e2e/container/proxy_signal_test.go | 2 +- e2e/container/rename_test.go | 2 +- e2e/container/run_test.go | 4 +- e2e/context/context_test.go | 2 +- e2e/context/main_test.go | 2 +- e2e/global/cli_test.go | 8 ++-- e2e/global/main_test.go | 2 +- e2e/image/build_test.go | 6 +-- e2e/image/main_test.go | 2 +- e2e/image/private_test.go | 2 +- e2e/image/pull_test.go | 2 +- e2e/internal/fixtures/fixtures.go | 2 +- e2e/plugin/main_test.go | 2 +- e2e/plugin/plugin_test.go | 6 +-- e2e/registry/main_test.go | 2 +- e2e/stack/main_test.go | 2 +- e2e/stack/remove_test.go | 2 +- e2e/system/main_test.go | 2 +- go.mod | 2 +- internal/commands/commands.go | 2 +- internal/jsonstream/display.go | 2 +- internal/jsonstream/display_test.go | 2 +- internal/oauth/api/api.go | 2 +- internal/oauth/manager/manager.go | 14 +++---- internal/oauth/manager/manager_test.go | 6 +-- internal/oauth/manager/util.go | 4 +- internal/prompt/prompt.go | 2 +- internal/prompt/prompt_test.go | 6 +-- internal/registryclient/client.go | 2 +- internal/registryclient/endpoint.go | 2 +- internal/registryclient/fetcher.go | 4 +- internal/test/cli.go | 14 +++---- internal/test/cmd.go | 4 +- internal/tui/output.go | 2 +- man/generate.go | 6 +-- opts/opts.go | 2 +- opts/parse.go | 2 +- scripts/build/.variables | 12 +++--- scripts/build/plugins | 2 +- 483 files changed, 1191 insertions(+), 1191 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f34497ee7051..1d39b34d354d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,7 @@ jobs: - name: Test run: | - go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/e2e/') + go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/v29/e2e/') go tool cover -func=/tmp/coverage.txt working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli shell: bash diff --git a/README.md b/README.md index 512eb9ab0f50..29c6664ce91a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Docker CLI -[![PkgGoDev](https://pkg.go.dev/badge/github.com/docker/cli)](https://pkg.go.dev/github.com/docker/cli) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/docker/cli/v29)](https://pkg.go.dev/github.com/docker/cli/v29) [![Build Status](https://img.shields.io/github/actions/workflow/status/docker/cli/build.yml?branch=master&label=build&logo=github)](https://github.com/docker/cli/actions?query=workflow%3Abuild) [![Test Status](https://img.shields.io/github/actions/workflow/status/docker/cli/test.yml?branch=master&label=test&logo=github)](https://github.com/docker/cli/actions?query=workflow%3Atest) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/docker/cli/badge)](https://scorecard.dev/viewer/?uri=github.com/docker/cli) diff --git a/TESTING.md b/TESTING.md index ab1a09e32db7..665f19829fb9 100644 --- a/TESTING.md +++ b/TESTING.md @@ -29,7 +29,7 @@ Assertions should be made using [gotest.tools/assert](https://godoc.org/gotest.tools/assert). Fakes, and testing utilities can be found in -[internal/test](https://godoc.org/github.com/docker/cli/internal/test) and +[internal/test](https://pkg.go.dev/github.com/docker/cli/v29/internal/test) and [gotest.tools](https://godoc.org/gotest.tools). ## End-to-End Test Suite diff --git a/cli-plugins/examples/helloworld/main.go b/cli-plugins/examples/helloworld/main.go index 874c0a942857..ab72cc3da700 100644 --- a/cli-plugins/examples/helloworld/main.go +++ b/cli-plugins/examples/helloworld/main.go @@ -5,9 +5,9 @@ import ( "fmt" "os" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli-plugins/plugin" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/plugin" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli-plugins/hooks/hooks_utils_test.go b/cli-plugins/hooks/hooks_utils_test.go index 877909109cc7..3c31ae4243cb 100644 --- a/cli-plugins/hooks/hooks_utils_test.go +++ b/cli-plugins/hooks/hooks_utils_test.go @@ -3,7 +3,7 @@ package hooks_test import ( "testing" - "github.com/docker/cli/cli-plugins/hooks" + "github.com/docker/cli/v29/cli-plugins/hooks" ) func TestTemplateHelpers(t *testing.T) { diff --git a/cli-plugins/hooks/printer_test.go b/cli-plugins/hooks/printer_test.go index 8b1ca9234ed8..24dcdba9f18e 100644 --- a/cli-plugins/hooks/printer_test.go +++ b/cli-plugins/hooks/printer_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli-plugins/hooks" + "github.com/docker/cli/v29/cli-plugins/hooks" "gotest.tools/v3/assert" ) diff --git a/cli-plugins/hooks/template_test.go b/cli-plugins/hooks/template_test.go index 28b290696f1d..53231c5e3d6c 100644 --- a/cli-plugins/hooks/template_test.go +++ b/cli-plugins/hooks/template_test.go @@ -3,7 +3,7 @@ package hooks_test import ( "testing" - "github.com/docker/cli/cli-plugins/hooks" + "github.com/docker/cli/v29/cli-plugins/hooks" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/cli-plugins/manager/candidate.go b/cli-plugins/manager/candidate.go index a4253968dcca..7f18f89ac097 100644 --- a/cli-plugins/manager/candidate.go +++ b/cli-plugins/manager/candidate.go @@ -3,7 +3,7 @@ package manager import ( "os/exec" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" ) type candidate struct { diff --git a/cli-plugins/manager/candidate_test.go b/cli-plugins/manager/candidate_test.go index 976aa74bb5fb..d85679554d68 100644 --- a/cli-plugins/manager/candidate_test.go +++ b/cli-plugins/manager/candidate_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" "github.com/spf13/cobra" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli-plugins/manager/cobra.go b/cli-plugins/manager/cobra.go index 6d5bfd3b7e1a..247482666cdf 100644 --- a/cli-plugins/manager/cobra.go +++ b/cli-plugins/manager/cobra.go @@ -5,8 +5,8 @@ import ( "os" "sync" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/config" "github.com/spf13/cobra" ) diff --git a/cli-plugins/manager/cobra_test.go b/cli-plugins/manager/cobra_test.go index 0de070fefddc..74daba670fbc 100644 --- a/cli-plugins/manager/cobra_test.go +++ b/cli-plugins/manager/cobra_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/cli-plugins/manager/hooks.go b/cli-plugins/manager/hooks.go index 5a3d3ebe9191..9a5800a4d7f6 100644 --- a/cli-plugins/manager/hooks.go +++ b/cli-plugins/manager/hooks.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli-plugins/hooks" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" + "github.com/docker/cli/v29/cli-plugins/hooks" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/cli-plugins/manager/hooks_test.go b/cli-plugins/manager/hooks_test.go index e39a1383118f..4fb03292b532 100644 --- a/cli-plugins/manager/hooks_test.go +++ b/cli-plugins/manager/hooks_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/cli/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/configfile" "github.com/spf13/cobra" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index bf398533aa22..17b333b41dcc 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -14,10 +14,10 @@ import ( "sync" "github.com/containerd/errdefs" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/debug" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/debug" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" diff --git a/cli-plugins/manager/manager_test.go b/cli-plugins/manager/manager_test.go index 07df0f8ecccb..e6e64e7b5d48 100644 --- a/cli-plugins/manager/manager_test.go +++ b/cli-plugins/manager/manager_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/containerd/errdefs" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" "github.com/spf13/cobra" "gotest.tools/v3/assert" "gotest.tools/v3/fs" diff --git a/cli-plugins/manager/plugin.go b/cli-plugins/manager/plugin.go index e0fe50425463..41b4ed652d41 100644 --- a/cli-plugins/manager/plugin.go +++ b/cli-plugins/manager/plugin.go @@ -15,8 +15,8 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli-plugins/hooks" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/hooks" + "github.com/docker/cli/v29/cli-plugins/metadata" "github.com/spf13/cobra" ) diff --git a/cli-plugins/manager/telemetry.go b/cli-plugins/manager/telemetry.go index ab3dace41449..eb3e7d19e4a5 100644 --- a/cli-plugins/manager/telemetry.go +++ b/cli-plugins/manager/telemetry.go @@ -5,7 +5,7 @@ import ( "os" "strings" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" "github.com/spf13/cobra" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" diff --git a/cli-plugins/plugin/plugin.go b/cli-plugins/plugin/plugin.go index a90e4b6f6cbe..30ba4bc627de 100644 --- a/cli-plugins/plugin/plugin.go +++ b/cli-plugins/plugin/plugin.go @@ -11,12 +11,12 @@ import ( "os" "sync" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli-plugins/socket" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/connhelper" - "github.com/docker/cli/cli/debug" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/socket" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/connhelper" + "github.com/docker/cli/v29/cli/debug" "github.com/moby/moby/client" "github.com/spf13/cobra" "go.opentelemetry.io/otel" diff --git a/cli/cobra.go b/cli/cobra.go index bfcb1bdcc8f2..c5fd2906316f 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -9,9 +9,9 @@ import ( "slices" "strings" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/command" - cliflags "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/command" + cliflags "github.com/docker/cli/v29/cli/flags" "github.com/fvbommel/sortorder" "github.com/moby/term" "github.com/morikuni/aec" diff --git a/cli/cobra_test.go b/cli/cobra_test.go index eb87c75d4184..ad7db939fc00 100644 --- a/cli/cobra_test.go +++ b/cli/cobra_test.go @@ -3,7 +3,7 @@ package cli import ( "testing" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/cobra" "gotest.tools/v3/assert" diff --git a/cli/command/builder/cmd.go b/cli/command/builder/cmd.go index 8aa693e5b53c..6746f34c60d6 100644 --- a/cli/command/builder/cmd.go +++ b/cli/command/builder/cmd.go @@ -3,10 +3,10 @@ package builder import ( "github.com/spf13/cobra" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/image" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/image" + "github.com/docker/cli/v29/internal/commands" ) func init() { diff --git a/cli/command/builder/prune.go b/cli/command/builder/prune.go index a7c88dcc42ac..b1b87e9f52b2 100644 --- a/cli/command/builder/prune.go +++ b/cli/command/builder/prune.go @@ -6,11 +6,11 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/docker/go-units" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/builder/prune_test.go b/cli/command/builder/prune_test.go index 884523197e2b..6f4455871aca 100644 --- a/cli/command/builder/prune_test.go +++ b/cli/command/builder/prune_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" ) diff --git a/cli/command/checkpoint/cmd.go b/cli/command/checkpoint/cmd.go index fd33bd8a8da8..0db2e66f620a 100644 --- a/cli/command/checkpoint/cmd.go +++ b/cli/command/checkpoint/cmd.go @@ -1,9 +1,9 @@ package checkpoint import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/checkpoint/create.go b/cli/command/checkpoint/create.go index d361d78aa0fa..13c6745f59fc 100644 --- a/cli/command/checkpoint/create.go +++ b/cli/command/checkpoint/create.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/checkpoint/create_test.go b/cli/command/checkpoint/create_test.go index 5f91c0493a5d..42f7f8909d19 100644 --- a/cli/command/checkpoint/create_test.go +++ b/cli/command/checkpoint/create_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/checkpoint/formatter.go b/cli/command/checkpoint/formatter.go index 915ce1832dc0..58040869b867 100644 --- a/cli/command/checkpoint/formatter.go +++ b/cli/command/checkpoint/formatter.go @@ -1,7 +1,7 @@ package checkpoint import ( - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/checkpoint" ) diff --git a/cli/command/checkpoint/formatter_test.go b/cli/command/checkpoint/formatter_test.go index 5704fa45b9ce..58de76549d91 100644 --- a/cli/command/checkpoint/formatter_test.go +++ b/cli/command/checkpoint/formatter_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/checkpoint" "gotest.tools/v3/assert" ) diff --git a/cli/command/checkpoint/list.go b/cli/command/checkpoint/list.go index 6ee0ed8f738b..032d63651094 100644 --- a/cli/command/checkpoint/list.go +++ b/cli/command/checkpoint/list.go @@ -3,10 +3,10 @@ package checkpoint import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/checkpoint/list_test.go b/cli/command/checkpoint/list_test.go index 26e9e5511984..5a9698e5afa0 100644 --- a/cli/command/checkpoint/list_test.go +++ b/cli/command/checkpoint/list_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/checkpoint" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/checkpoint/remove.go b/cli/command/checkpoint/remove.go index 773a69407fcb..d6622c03d332 100644 --- a/cli/command/checkpoint/remove.go +++ b/cli/command/checkpoint/remove.go @@ -1,8 +1,8 @@ package checkpoint import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/checkpoint/remove_test.go b/cli/command/checkpoint/remove_test.go index 30777da8cff9..f6872f75535d 100644 --- a/cli/command/checkpoint/remove_test.go +++ b/cli/command/checkpoint/remove_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/cli.go b/cli/command/cli.go index 0d2f4b506f63..2191893a93fe 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -14,16 +14,16 @@ import ( "sync" "time" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - dcontext "github.com/docker/cli/cli/context" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" - "github.com/docker/cli/cli/debug" - cliflags "github.com/docker/cli/cli/flags" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/cli/version" - dopts "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + dcontext "github.com/docker/cli/v29/cli/context" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" + "github.com/docker/cli/v29/cli/debug" + cliflags "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/cli/version" + dopts "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/build" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/cli_options.go b/cli/command/cli_options.go index 733cfbdf64c7..a33995a57eec 100644 --- a/cli/command/cli_options.go +++ b/cli/command/cli_options.go @@ -10,7 +10,7 @@ import ( "os" "strings" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/moby/client" "github.com/moby/term" ) diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index 09c093d5ddef..ad5143de5efb 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -16,10 +16,10 @@ import ( "testing" "time" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/context/store" - "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/context/store" + "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "gotest.tools/v3/assert" ) diff --git a/cli/command/commands/commands.go b/cli/command/commands/commands.go index 2b375938c9ec..9e61c205cf92 100644 --- a/cli/command/commands/commands.go +++ b/cli/command/commands/commands.go @@ -1,25 +1,25 @@ package commands import ( - "github.com/docker/cli/cli/command" - _ "github.com/docker/cli/cli/command/builder" - _ "github.com/docker/cli/cli/command/checkpoint" - _ "github.com/docker/cli/cli/command/config" - _ "github.com/docker/cli/cli/command/container" - _ "github.com/docker/cli/cli/command/context" - _ "github.com/docker/cli/cli/command/image" - _ "github.com/docker/cli/cli/command/manifest" - _ "github.com/docker/cli/cli/command/network" - _ "github.com/docker/cli/cli/command/node" - _ "github.com/docker/cli/cli/command/plugin" - _ "github.com/docker/cli/cli/command/registry" - _ "github.com/docker/cli/cli/command/secret" - _ "github.com/docker/cli/cli/command/service" - _ "github.com/docker/cli/cli/command/stack" - _ "github.com/docker/cli/cli/command/swarm" - _ "github.com/docker/cli/cli/command/system" - _ "github.com/docker/cli/cli/command/volume" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli/command" + _ "github.com/docker/cli/v29/cli/command/builder" + _ "github.com/docker/cli/v29/cli/command/checkpoint" + _ "github.com/docker/cli/v29/cli/command/config" + _ "github.com/docker/cli/v29/cli/command/container" + _ "github.com/docker/cli/v29/cli/command/context" + _ "github.com/docker/cli/v29/cli/command/image" + _ "github.com/docker/cli/v29/cli/command/manifest" + _ "github.com/docker/cli/v29/cli/command/network" + _ "github.com/docker/cli/v29/cli/command/node" + _ "github.com/docker/cli/v29/cli/command/plugin" + _ "github.com/docker/cli/v29/cli/command/registry" + _ "github.com/docker/cli/v29/cli/command/secret" + _ "github.com/docker/cli/v29/cli/command/service" + _ "github.com/docker/cli/v29/cli/command/stack" + _ "github.com/docker/cli/v29/cli/command/swarm" + _ "github.com/docker/cli/v29/cli/command/system" + _ "github.com/docker/cli/v29/cli/command/volume" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/config/cmd.go b/cli/command/config/cmd.go index 588f100fb7d0..c23ea71a1702 100644 --- a/cli/command/config/cmd.go +++ b/cli/command/config/cmd.go @@ -1,10 +1,10 @@ package config import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/commands" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/config/create.go b/cli/command/config/create.go index d81011675fa6..9d22546bddd7 100644 --- a/cli/command/config/create.go +++ b/cli/command/config/create.go @@ -6,9 +6,9 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/moby/sys/sequential" diff --git a/cli/command/config/create_test.go b/cli/command/config/create_test.go index 54068423dfd7..bcfc27b7a383 100644 --- a/cli/command/config/create_test.go +++ b/cli/command/config/create_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/config/formatter.go b/cli/command/config/formatter.go index 9453dec77e76..23f0d6ae1235 100644 --- a/cli/command/config/formatter.go +++ b/cli/command/config/formatter.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/inspect" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/inspect" "github.com/docker/go-units" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/config/formatter_test.go b/cli/command/config/formatter_test.go index 7675b285c388..eb0306d4aff6 100644 --- a/cli/command/config/formatter_test.go +++ b/cli/command/config/formatter_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/config/inspect.go b/cli/command/config/inspect.go index a7ac66290031..36ba3913df5a 100644 --- a/cli/command/config/inspect.go +++ b/cli/command/config/inspect.go @@ -8,10 +8,10 @@ import ( "errors" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/config/inspect_test.go b/cli/command/config/inspect_test.go index fd02924fa59e..8123f07ada96 100644 --- a/cli/command/config/inspect_test.go +++ b/cli/command/config/inspect_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/cli/command/config/ls.go b/cli/command/config/ls.go index 94541fcb575d..d03e83f2e37a 100644 --- a/cli/command/config/ls.go +++ b/cli/command/config/ls.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/config/ls_test.go b/cli/command/config/ls_test.go index 9f6d97eefdf0..ed0f82daee8c 100644 --- a/cli/command/config/ls_test.go +++ b/cli/command/config/ls_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/config/remove.go b/cli/command/config/remove.go index 0b3462404c81..2371fa70deec 100644 --- a/cli/command/config/remove.go +++ b/cli/command/config/remove.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/config/remove_test.go b/cli/command/config/remove_test.go index dbe8ed8b9e0c..1a5749763650 100644 --- a/cli/command/config/remove_test.go +++ b/cli/command/config/remove_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/attach.go b/cli/command/container/attach.go index f31a13f27b86..1b518cb9ac14 100644 --- a/cli/command/container/attach.go +++ b/cli/command/container/attach.go @@ -5,9 +5,9 @@ import ( "errors" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/moby/sys/signal" diff --git a/cli/command/container/attach_test.go b/cli/command/container/attach_test.go index 3f1410b16494..1b9cac96b785 100644 --- a/cli/command/container/attach_test.go +++ b/cli/command/container/attach_test.go @@ -5,8 +5,8 @@ import ( "io" "testing" - "github.com/docker/cli/cli" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/auth_config_utils.go b/cli/command/container/auth_config_utils.go index f908bd84982f..64e4d49ddeef 100644 --- a/cli/command/container/auth_config_utils.go +++ b/cli/command/container/auth_config_utils.go @@ -5,9 +5,9 @@ import ( "os" "strings" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/types" ) // readCredentials resolves auth-config from the current environment to be diff --git a/cli/command/container/cmd.go b/cli/command/container/cmd.go index 4a6174d50d25..664a755749aa 100644 --- a/cli/command/container/cmd.go +++ b/cli/command/container/cmd.go @@ -1,9 +1,9 @@ package container import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/container/commit.go b/cli/command/container/commit.go index 9d5c2ea0a99c..b7ff925942a1 100644 --- a/cli/command/container/commit.go +++ b/cli/command/container/commit.go @@ -5,10 +5,10 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/commit_test.go b/cli/command/container/commit_test.go index fa8164d0291d..11f8d0f74729 100644 --- a/cli/command/container/commit_test.go +++ b/cli/command/container/commit_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/completion.go b/cli/command/container/completion.go index 97d32728fa84..de4ccd06071d 100644 --- a/cli/command/container/completion.go +++ b/cli/command/container/completion.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/moby/sys/capability" diff --git a/cli/command/container/completion_test.go b/cli/command/container/completion_test.go index 649e4701e890..13c23e84026e 100644 --- a/cli/command/container/completion_test.go +++ b/cli/command/container/completion_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/moby/sys/signal" diff --git a/cli/command/container/cp.go b/cli/command/container/cp.go index fbce9df646e5..244cd46ef7c2 100644 --- a/cli/command/container/cp.go +++ b/cli/command/container/cp.go @@ -13,9 +13,9 @@ import ( "sync/atomic" "time" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/streams" "github.com/docker/go-units" "github.com/moby/go-archive" "github.com/moby/moby/client" diff --git a/cli/command/container/cp_test.go b/cli/command/container/cp_test.go index e193ebbf411b..3f4825d8fd41 100644 --- a/cli/command/container/cp_test.go +++ b/cli/command/container/cp_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/go-archive" "github.com/moby/go-archive/compression" "github.com/moby/moby/api/types/container" diff --git a/cli/command/container/create.go b/cli/command/container/create.go index 122d15e2e149..4e0afcc2a88a 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -14,14 +14,14 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/jsonstream" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/jsonstream" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/mount" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index 9c0099904e3b..8d713278aeee 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -10,9 +10,9 @@ import ( "strings" "testing" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/container" diff --git a/cli/command/container/diff.go b/cli/command/container/diff.go index feb0f843e80f..947feb8d1584 100644 --- a/cli/command/container/diff.go +++ b/cli/command/container/diff.go @@ -3,10 +3,10 @@ package container import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/diff_test.go b/cli/command/container/diff_test.go index 1e941d974569..4a115da419b2 100644 --- a/cli/command/container/diff_test.go +++ b/cli/command/container/diff_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/exec.go b/cli/command/container/exec.go index bd4f9bc6242c..6477dbd80d32 100644 --- a/cli/command/container/exec.go +++ b/cli/command/container/exec.go @@ -6,11 +6,11 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/sirupsen/logrus" diff --git a/cli/command/container/exec_test.go b/cli/command/container/exec_test.go index 47b6574ec513..902e5762ef4d 100644 --- a/cli/command/container/exec_test.go +++ b/cli/command/container/exec_test.go @@ -8,10 +8,10 @@ import ( "strconv" "testing" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/export.go b/cli/command/container/export.go index 0c0f3410b5ed..0863344c5c26 100644 --- a/cli/command/container/export.go +++ b/cli/command/container/export.go @@ -6,9 +6,9 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/moby/sys/atomicwriter" "github.com/spf13/cobra" diff --git a/cli/command/container/export_test.go b/cli/command/container/export_test.go index 8fe6be06b9ff..de06544f5068 100644 --- a/cli/command/container/export_test.go +++ b/cli/command/container/export_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/fs" diff --git a/cli/command/container/formatter_diff.go b/cli/command/container/formatter_diff.go index 35c48d5d1bda..6c74a28b710f 100644 --- a/cli/command/container/formatter_diff.go +++ b/cli/command/container/formatter_diff.go @@ -1,7 +1,7 @@ package container import ( - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" ) diff --git a/cli/command/container/formatter_diff_test.go b/cli/command/container/formatter_diff_test.go index 0d2849d25cfd..5ff3d09d6281 100644 --- a/cli/command/container/formatter_diff_test.go +++ b/cli/command/container/formatter_diff_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/formatter_stats.go b/cli/command/container/formatter_stats.go index b814038a27d2..9633bf981820 100644 --- a/cli/command/container/formatter_stats.go +++ b/cli/command/container/formatter_stats.go @@ -5,7 +5,7 @@ import ( "strings" "sync" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/docker/go-units" ) diff --git a/cli/command/container/formatter_stats_test.go b/cli/command/container/formatter_stats_test.go index 59a7d70429a1..9b709ae90e78 100644 --- a/cli/command/container/formatter_stats_test.go +++ b/cli/command/container/formatter_stats_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/container/hijack.go b/cli/command/container/hijack.go index 1ce40962c927..aa3f4f1678bc 100644 --- a/cli/command/container/hijack.go +++ b/cli/command/container/hijack.go @@ -7,7 +7,7 @@ import ( "runtime" "sync" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/pkg/stdcopy" "github.com/moby/moby/client" "github.com/moby/term" diff --git a/cli/command/container/inspect.go b/cli/command/container/inspect.go index 9ebd45016cbf..eafcdcf742a9 100644 --- a/cli/command/container/inspect.go +++ b/cli/command/container/inspect.go @@ -6,11 +6,11 @@ package container import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/kill.go b/cli/command/container/kill.go index 368c35a4de2b..7f8d7b49f427 100644 --- a/cli/command/container/kill.go +++ b/cli/command/container/kill.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/kill_test.go b/cli/command/container/kill_test.go index fdaa2eb96f7c..3d11c09215f1 100644 --- a/cli/command/container/kill_test.go +++ b/cli/command/container/kill_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/list.go b/cli/command/container/list.go index eb63f6722c05..53e31fbd3095 100644 --- a/cli/command/container/list.go +++ b/cli/command/container/list.go @@ -5,12 +5,12 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" + "github.com/docker/cli/v29/templates" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/list_test.go b/cli/command/container/list_test.go index 2f49e9721e68..d8a464c3dad8 100644 --- a/cli/command/container/list_test.go +++ b/cli/command/container/list_test.go @@ -5,10 +5,10 @@ import ( "io" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/logs.go b/cli/command/container/logs.go index ebdbc1f62516..789e0a63eb09 100644 --- a/cli/command/container/logs.go +++ b/cli/command/container/logs.go @@ -4,9 +4,9 @@ import ( "context" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/pkg/stdcopy" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/logs_test.go b/cli/command/container/logs_test.go index 06130925455e..8ec32ed77879 100644 --- a/cli/command/container/logs_test.go +++ b/cli/command/container/logs_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index 94b8dffa34a6..ebf00288b92f 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -18,9 +18,9 @@ import ( "strings" "time" - "github.com/docker/cli/internal/lazyregexp" - "github.com/docker/cli/internal/volumespec" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/internal/lazyregexp" + "github.com/docker/cli/v29/internal/volumespec" + "github.com/docker/cli/v29/opts" "github.com/docker/go-connections/nat" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/mount" diff --git a/cli/command/container/pause.go b/cli/command/container/pause.go index ede873bfb1d9..ce594a889cd6 100644 --- a/cli/command/container/pause.go +++ b/cli/command/container/pause.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/pause_test.go b/cli/command/container/pause_test.go index 41619c177282..4a68ed82c671 100644 --- a/cli/command/container/pause_test.go +++ b/cli/command/container/pause_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/port.go b/cli/command/container/port.go index 839e40ca2f96..86c4fb048ac0 100644 --- a/cli/command/container/port.go +++ b/cli/command/container/port.go @@ -10,9 +10,9 @@ import ( "slices" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/command/container/port_test.go b/cli/command/container/port_test.go index 8fbe37aca7d2..6eea290f5e47 100644 --- a/cli/command/container/port_test.go +++ b/cli/command/container/port_test.go @@ -5,7 +5,7 @@ import ( "net/netip" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/command/container/prune.go b/cli/command/container/prune.go index 90aa540e2467..f05f37a1b6a9 100644 --- a/cli/command/container/prune.go +++ b/cli/command/container/prune.go @@ -6,11 +6,11 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/docker/go-units" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/prune_test.go b/cli/command/container/prune_test.go index 68ac21c3e08f..57cc42b555c8 100644 --- a/cli/command/container/prune_test.go +++ b/cli/command/container/prune_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" ) diff --git a/cli/command/container/rename.go b/cli/command/container/rename.go index f875bddeacf7..cf85f47a11f7 100644 --- a/cli/command/container/rename.go +++ b/cli/command/container/rename.go @@ -3,9 +3,9 @@ package container import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/restart.go b/cli/command/container/restart.go index 4aad94351f15..7d348ac794a7 100644 --- a/cli/command/container/restart.go +++ b/cli/command/container/restart.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/restart_test.go b/cli/command/container/restart_test.go index 475444686638..b7d7d6f7408e 100644 --- a/cli/command/container/restart_test.go +++ b/cli/command/container/restart_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/rm.go b/cli/command/container/rm.go index eaa23dec04bc..6996c51251c2 100644 --- a/cli/command/container/rm.go +++ b/cli/command/container/rm.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/rm_test.go b/cli/command/container/rm_test.go index 5e31e9abbcd5..951be7ade74c 100644 --- a/cli/command/container/rm_test.go +++ b/cli/command/container/rm_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/run.go b/cli/command/container/run.go index 3c25630d6b78..b03ff301b343 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -9,10 +9,10 @@ import ( "strings" "syscall" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/moby/sys/signal" diff --git a/cli/command/container/run_test.go b/cli/command/container/run_test.go index 00b0912abe34..ea2b1afdbfde 100644 --- a/cli/command/container/run_test.go +++ b/cli/command/container/run_test.go @@ -10,9 +10,9 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" diff --git a/cli/command/container/start.go b/cli/command/container/start.go index f6cdd0c211f6..d1119566e7c7 100644 --- a/cli/command/container/start.go +++ b/cli/command/container/start.go @@ -10,9 +10,9 @@ import ( "io" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/moby/sys/signal" diff --git a/cli/command/container/start_test.go b/cli/command/container/start_test.go index a19a7998cc08..2ad86c154622 100644 --- a/cli/command/container/start_test.go +++ b/cli/command/container/start_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/container/stats.go b/cli/command/container/stats.go index c0370f95e5f2..8d7db38c6540 100644 --- a/cli/command/container/stats.go +++ b/cli/command/container/stats.go @@ -13,11 +13,11 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/log" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/api/types/events" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/stop.go b/cli/command/container/stop.go index 0834d52f7eb9..f78e61e65ea5 100644 --- a/cli/command/container/stop.go +++ b/cli/command/container/stop.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/stop_test.go b/cli/command/container/stop_test.go index 484e7b4f39f5..abf087c83d3d 100644 --- a/cli/command/container/stop_test.go +++ b/cli/command/container/stop_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/container/top.go b/cli/command/container/top.go index 6ed7350a49d9..7351f9ef5d95 100644 --- a/cli/command/container/top.go +++ b/cli/command/container/top.go @@ -5,10 +5,10 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter/tabwriter" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter/tabwriter" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/container/tty.go b/cli/command/container/tty.go index bdb4308bdc91..67fad6e3b909 100644 --- a/cli/command/container/tty.go +++ b/cli/command/container/tty.go @@ -11,7 +11,7 @@ import ( "runtime" "time" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/moby/sys/signal" "github.com/sirupsen/logrus" diff --git a/cli/command/container/tty_test.go b/cli/command/container/tty_test.go index 19162721f9c2..ec449cd36041 100644 --- a/cli/command/container/tty_test.go +++ b/cli/command/container/tty_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/container/unpause.go b/cli/command/container/unpause.go index c4223a87b7b5..653b8287804d 100644 --- a/cli/command/container/unpause.go +++ b/cli/command/container/unpause.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/update.go b/cli/command/container/update.go index 3bc11412e19a..7c05b0f751e4 100644 --- a/cli/command/container/update.go +++ b/cli/command/container/update.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" containertypes "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/container/wait.go b/cli/command/container/wait.go index 3aabf25e2db8..02e073352a79 100644 --- a/cli/command/container/wait.go +++ b/cli/command/container/wait.go @@ -6,9 +6,9 @@ import ( "fmt" "strconv" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/context.go b/cli/command/context.go index 153b046f5769..7e4f4681fc5d 100644 --- a/cli/command/context.go +++ b/cli/command/context.go @@ -8,7 +8,7 @@ import ( "errors" "maps" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" ) // DockerContext is a typed representation of what we put in Context metadata diff --git a/cli/command/context/cmd.go b/cli/command/context/cmd.go index 44bbb7e3d693..e7f8ef6e67c0 100644 --- a/cli/command/context/cmd.go +++ b/cli/command/context/cmd.go @@ -1,9 +1,9 @@ package context import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/context/completion.go b/cli/command/context/completion.go index f5ea6ad30ccb..5c9126c7ba6d 100644 --- a/cli/command/context/completion.go +++ b/cli/command/context/completion.go @@ -6,7 +6,7 @@ package context import ( "slices" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cli/command/context/completion_test.go b/cli/command/context/completion_test.go index d464ebf1d645..f899e4d75a4b 100644 --- a/cli/command/context/completion_test.go +++ b/cli/command/context/completion_test.go @@ -3,7 +3,7 @@ package context import ( "testing" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/context/create.go b/cli/command/context/create.go index 81e4418939b5..fd07b9c0938d 100644 --- a/cli/command/context/create.go +++ b/cli/command/context/create.go @@ -9,11 +9,11 @@ import ( "fmt" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter/tabwriter" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter/tabwriter" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cli/command/context/create_test.go b/cli/command/context/create_test.go index 4dc62b215feb..e7114b461b6e 100644 --- a/cli/command/context/create_test.go +++ b/cli/command/context/create_test.go @@ -7,11 +7,11 @@ import ( "fmt" "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/command/context/export-import_test.go b/cli/command/context/export-import_test.go index cfbac778ad6f..12e9c42e0516 100644 --- a/cli/command/context/export-import_test.go +++ b/cli/command/context/export-import_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/streams" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/context/export.go b/cli/command/context/export.go index 53f7e1fb989a..66f5bdd5a5b4 100644 --- a/cli/command/context/export.go +++ b/cli/command/context/export.go @@ -6,9 +6,9 @@ import ( "io" "os" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cli/command/context/import.go b/cli/command/context/import.go index 47c0bbcac3e4..e04d7483f46a 100644 --- a/cli/command/context/import.go +++ b/cli/command/context/import.go @@ -5,10 +5,10 @@ import ( "io" "os" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cli/command/context/inspect.go b/cli/command/context/inspect.go index be1300f0a8e9..0fc22e600f86 100644 --- a/cli/command/context/inspect.go +++ b/cli/command/context/inspect.go @@ -6,10 +6,10 @@ package context import ( "errors" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/inspect" - "github.com/docker/cli/cli/context/store" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/inspect" + "github.com/docker/cli/v29/cli/context/store" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/spf13/cobra" ) diff --git a/cli/command/context/list.go b/cli/command/context/list.go index 3507ae9c2205..db7fe1061ba3 100644 --- a/cli/command/context/list.go +++ b/cli/command/context/list.go @@ -8,11 +8,11 @@ import ( "os" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/context/docker" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/context/docker" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/fvbommel/sortorder" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/context/list_test.go b/cli/command/context/list_test.go index ccd1678ef145..2bdfacca901d 100644 --- a/cli/command/context/list_test.go +++ b/cli/command/context/list_test.go @@ -3,8 +3,8 @@ package context import ( "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" "gotest.tools/v3/assert" "gotest.tools/v3/golden" ) diff --git a/cli/command/context/options.go b/cli/command/context/options.go index 979b6927363b..563f019a6cea 100644 --- a/cli/command/context/options.go +++ b/cli/command/context/options.go @@ -8,9 +8,9 @@ import ( "fmt" "strconv" - "github.com/docker/cli/cli/context" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" "github.com/moby/moby/client" ) diff --git a/cli/command/context/remove.go b/cli/command/context/remove.go index 7627ee73b175..28f6f52aae72 100644 --- a/cli/command/context/remove.go +++ b/cli/command/context/remove.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cli/command/context/remove_test.go b/cli/command/context/remove_test.go index d121f39d6df8..8c28b050d733 100644 --- a/cli/command/context/remove_test.go +++ b/cli/command/context/remove_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/containerd/errdefs" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/context/show.go b/cli/command/context/show.go index 0418444cf228..bd30cb4b7b43 100644 --- a/cli/command/context/show.go +++ b/cli/command/context/show.go @@ -3,8 +3,8 @@ package context import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cli/command/context/update.go b/cli/command/context/update.go index cdd79e578d33..962b013a6f72 100644 --- a/cli/command/context/update.go +++ b/cli/command/context/update.go @@ -4,11 +4,11 @@ import ( "bytes" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter/tabwriter" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter/tabwriter" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cli/command/context/update_test.go b/cli/command/context/update_test.go index c2fc968c2ab5..5d32cf130d02 100644 --- a/cli/command/context/update_test.go +++ b/cli/command/context/update_test.go @@ -3,8 +3,8 @@ package context import ( "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/context/docker" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/context/docker" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/context/use.go b/cli/command/context/use.go index 5b4cd1de09ec..9a84beedb5e9 100644 --- a/cli/command/context/use.go +++ b/cli/command/context/use.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/context/store" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/context/use_test.go b/cli/command/context/use_test.go index 997f5c1474a5..e76364e43691 100644 --- a/cli/command/context/use_test.go +++ b/cli/command/context/use_test.go @@ -10,10 +10,10 @@ import ( "testing" "github.com/containerd/errdefs" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/flags" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/defaultcontextstore.go b/cli/command/defaultcontextstore.go index 90be220155a3..41f34efec802 100644 --- a/cli/command/defaultcontextstore.go +++ b/cli/command/defaultcontextstore.go @@ -7,9 +7,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" - cliflags "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" + cliflags "github.com/docker/cli/v29/cli/flags" ) const ( diff --git a/cli/command/defaultcontextstore_test.go b/cli/command/defaultcontextstore_test.go index 3a7ef5a38405..f0e8b1ef7891 100644 --- a/cli/command/defaultcontextstore_test.go +++ b/cli/command/defaultcontextstore_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/containerd/errdefs" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" - cliflags "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" + cliflags "github.com/docker/cli/v29/cli/flags" "github.com/docker/go-connections/tlsconfig" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/formatter/container_test.go b/cli/command/formatter/container_test.go index 07df93d9aeed..38859c30e126 100644 --- a/cli/command/formatter/container_test.go +++ b/cli/command/formatter/container_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/container" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" diff --git a/cli/command/formatter/formatter.go b/cli/command/formatter/formatter.go index 4beb7f56b256..52459441badd 100644 --- a/cli/command/formatter/formatter.go +++ b/cli/command/formatter/formatter.go @@ -10,8 +10,8 @@ import ( "strings" "text/template" - "github.com/docker/cli/cli/command/formatter/tabwriter" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli/command/formatter/tabwriter" + "github.com/docker/cli/v29/templates" ) // Format keys used to specify certain kinds of output formats diff --git a/cli/command/formatter/image_test.go b/cli/command/formatter/image_test.go index c3906687c4fa..5625c94047ef 100644 --- a/cli/command/formatter/image_test.go +++ b/cli/command/formatter/image_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/formatter/volume_test.go b/cli/command/formatter/volume_test.go index bcb4227c24c0..4c16d04f8930 100644 --- a/cli/command/formatter/volume_test.go +++ b/cli/command/formatter/volume_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/idresolver/idresolver_test.go b/cli/command/idresolver/idresolver_test.go index 62289d71e157..9a385b98323f 100644 --- a/cli/command/idresolver/idresolver_test.go +++ b/cli/command/idresolver/idresolver_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/build.go b/cli/command/image/build.go index 26a873985429..53883f70b80f 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -17,13 +17,13 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" "github.com/docker/cli-docs-tool/annotation" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/image/build" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/jsonstream" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/image/build" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/jsonstream" + "github.com/docker/cli/v29/opts" "github.com/moby/go-archive" buildtypes "github.com/moby/moby/api/types/build" "github.com/moby/moby/api/types/container" diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go index da746b8a93bd..601af108140d 100644 --- a/cli/command/image/build/context.go +++ b/cli/command/image/build/context.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "github.com/docker/cli/cli/command/image/build/internal/git" + "github.com/docker/cli/v29/cli/command/image/build/internal/git" "github.com/moby/go-archive" "github.com/moby/go-archive/compression" "github.com/moby/moby/client/pkg/progress" diff --git a/cli/command/image/build/context_detect.go b/cli/command/image/build/context_detect.go index c5edc4ecf161..50bfec319746 100644 --- a/cli/command/image/build/context_detect.go +++ b/cli/command/image/build/context_detect.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/docker/cli/cli/command/image/build/internal/urlutil" + "github.com/docker/cli/v29/cli/command/image/build/internal/urlutil" ) // ContextType describes the type (source) of build-context specified. diff --git a/cli/command/image/build/internal/urlutil/urlutil.go b/cli/command/image/build/internal/urlutil/urlutil.go index b1cf47ce316b..2d2a0cf871a1 100644 --- a/cli/command/image/build/internal/urlutil/urlutil.go +++ b/cli/command/image/build/internal/urlutil/urlutil.go @@ -8,7 +8,7 @@ package urlutil import ( "strings" - "github.com/docker/cli/internal/lazyregexp" + "github.com/docker/cli/v29/internal/lazyregexp" ) // urlPathWithFragmentSuffix matches fragments to use as Git reference and build diff --git a/cli/command/image/build_test.go b/cli/command/image/build_test.go index 1d61d05bbe70..aa7b0bd92ce4 100644 --- a/cli/command/image/build_test.go +++ b/cli/command/image/build_test.go @@ -11,8 +11,8 @@ import ( "slices" "testing" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp" "github.com/moby/go-archive/compression" "github.com/moby/moby/client" diff --git a/cli/command/image/cmd.go b/cli/command/image/cmd.go index aa3a5962f389..dc39d08ab979 100644 --- a/cli/command/image/cmd.go +++ b/cli/command/image/cmd.go @@ -1,9 +1,9 @@ package image import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/image/formatter_history.go b/cli/command/image/formatter_history.go index 3a2cc51df57a..741f30e58281 100644 --- a/cli/command/image/formatter_history.go +++ b/cli/command/image/formatter_history.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/docker/go-units" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" diff --git a/cli/command/image/formatter_history_test.go b/cli/command/image/formatter_history_test.go index 77c38dd09e7a..822fe5d162f3 100644 --- a/cli/command/image/formatter_history_test.go +++ b/cli/command/image/formatter_history_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/history.go b/cli/command/image/history.go index ef9be33a5d05..66b94043f4c6 100644 --- a/cli/command/image/history.go +++ b/cli/command/image/history.go @@ -5,11 +5,11 @@ import ( "fmt" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/image/history_test.go b/cli/command/image/history_test.go index 50a1fa8e8262..ff01b4d78b64 100644 --- a/cli/command/image/history_test.go +++ b/cli/command/image/history_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/import.go b/cli/command/image/import.go index b4be964050d0..9e6d87b094b8 100644 --- a/cli/command/image/import.go +++ b/cli/command/image/import.go @@ -6,11 +6,11 @@ import ( "strings" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/jsonstream" - dockeropts "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/jsonstream" + dockeropts "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/cobra" diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index 2b364d3efd29..2ddee9924612 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/image/inspect.go b/cli/command/image/inspect.go index 8304740866e0..d9855e662b67 100644 --- a/cli/command/image/inspect.go +++ b/cli/command/image/inspect.go @@ -8,11 +8,11 @@ import ( "context" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/command/image/inspect_test.go b/cli/command/image/inspect_test.go index ea49eb5bc60c..b994153034c7 100644 --- a/cli/command/image/inspect_test.go +++ b/cli/command/image/inspect_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/list.go b/cli/command/image/list.go index 626f06cb84eb..5c877bf65fd5 100644 --- a/cli/command/image/list.go +++ b/cli/command/image/list.go @@ -10,12 +10,12 @@ import ( "io" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 8ceafa12c29f..ffb430bddcb1 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -7,8 +7,8 @@ import ( "slices" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/load.go b/cli/command/image/load.go index 4fc939466189..8f0feb3488fa 100644 --- a/cli/command/image/load.go +++ b/cli/command/image/load.go @@ -7,10 +7,10 @@ import ( "io" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/jsonstream" "github.com/moby/moby/client" "github.com/moby/sys/sequential" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/command/image/load_test.go b/cli/command/image/load_test.go index 9ca0f321d5cf..175e7aa27d03 100644 --- a/cli/command/image/load_test.go +++ b/cli/command/image/load_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/cli/command/image/prune.go b/cli/command/image/prune.go index ca12bcf5998d..824c82c04075 100644 --- a/cli/command/image/prune.go +++ b/cli/command/image/prune.go @@ -7,11 +7,11 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/docker/go-units" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/image/prune_test.go b/cli/command/image/prune_test.go index a3c0ceac36ff..97b9787f47ea 100644 --- a/cli/command/image/prune_test.go +++ b/cli/command/image/prune_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/pull.go b/cli/command/image/pull.go index 7485d21a6880..9179d4c88f49 100644 --- a/cli/command/image/pull.go +++ b/cli/command/image/pull.go @@ -9,11 +9,11 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/jsonstream" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/cobra" diff --git a/cli/command/image/pull_test.go b/cli/command/image/pull_test.go index eb8edfbca699..32def9f32497 100644 --- a/cli/command/image/pull_test.go +++ b/cli/command/image/pull_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/image/push.go b/cli/command/image/push.go index 87e2f7dea4c4..f97cecb1386f 100644 --- a/cli/command/image/push.go +++ b/cli/command/image/push.go @@ -12,12 +12,12 @@ import ( "github.com/containerd/platforms" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/jsonstream" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/jsonstream" + "github.com/docker/cli/v29/internal/tui" "github.com/moby/moby/api/types/auxprogress" "github.com/moby/moby/client" "github.com/morikuni/aec" diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 3dbca45ca9df..2b4ce9ec6f6d 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/auxprogress" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/command/image/remove.go b/cli/command/image/remove.go index ea9e513edc91..dd757675bf4d 100644 --- a/cli/command/image/remove.go +++ b/cli/command/image/remove.go @@ -7,9 +7,9 @@ import ( "github.com/containerd/errdefs" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index e9386bc9d939..8e6a82761c6e 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/image/save.go b/cli/command/image/save.go index f900cb1da88b..87770aaf2c04 100644 --- a/cli/command/image/save.go +++ b/cli/command/image/save.go @@ -7,9 +7,9 @@ import ( "io" "github.com/containerd/platforms" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/moby/sys/atomicwriter" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/command/image/save_test.go b/cli/command/image/save_test.go index dbdad6c32b82..b3482b166e41 100644 --- a/cli/command/image/save_test.go +++ b/cli/command/image/save_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/image/tag.go b/cli/command/image/tag.go index 3a2ef56dd7b8..ebefd587f7b2 100644 --- a/cli/command/image/tag.go +++ b/cli/command/image/tag.go @@ -1,9 +1,9 @@ package image import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/image/tag_test.go b/cli/command/image/tag_test.go index e3c7768833e2..6cebae925dbf 100644 --- a/cli/command/image/tag_test.go +++ b/cli/command/image/tag_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index cd053c2f4bb1..753792fb273f 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -10,9 +10,9 @@ import ( "strings" "github.com/containerd/platforms" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/tui" "github.com/docker/go-units" imagetypes "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" diff --git a/cli/command/image/tree_test.go b/cli/command/image/tree_test.go index 4516c08a1bae..089acdb87df8 100644 --- a/cli/command/image/tree_test.go +++ b/cli/command/image/tree_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" "gotest.tools/v3/golden" ) diff --git a/cli/command/inspect/inspector.go b/cli/command/inspect/inspector.go index 1f154c088ffa..049941c27af7 100644 --- a/cli/command/inspect/inspector.go +++ b/cli/command/inspect/inspector.go @@ -11,8 +11,8 @@ import ( "io" "text/template" - "github.com/docker/cli/cli" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/templates" "github.com/sirupsen/logrus" ) diff --git a/cli/command/inspect/inspector_test.go b/cli/command/inspect/inspector_test.go index 142d50342ba3..9679c9d41e34 100644 --- a/cli/command/inspect/inspector_test.go +++ b/cli/command/inspect/inspector_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/templates" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/manifest/annotate.go b/cli/command/manifest/annotate.go index a9507deb73f0..ad0855b05356 100644 --- a/cli/command/manifest/annotate.go +++ b/cli/command/manifest/annotate.go @@ -10,11 +10,11 @@ import ( "slices" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/manifest/store" - "github.com/docker/cli/internal/registryclient" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/manifest/store" + "github.com/docker/cli/v29/internal/registryclient" "github.com/moby/moby/api/types/registry" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/cobra" diff --git a/cli/command/manifest/annotate_test.go b/cli/command/manifest/annotate_test.go index f2c924e45ffc..6c97a9df306d 100644 --- a/cli/command/manifest/annotate_test.go +++ b/cli/command/manifest/annotate_test.go @@ -4,8 +4,8 @@ import ( "io" "testing" - "github.com/docker/cli/cli/manifest/store" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/manifest/store" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" diff --git a/cli/command/manifest/client_test.go b/cli/command/manifest/client_test.go index 16b7912ab6f5..6554f3c23356 100644 --- a/cli/command/manifest/client_test.go +++ b/cli/command/manifest/client_test.go @@ -4,8 +4,8 @@ import ( "context" "github.com/distribution/reference" - manifesttypes "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/registryclient" + manifesttypes "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/registryclient" "github.com/docker/distribution" "github.com/opencontainers/go-digest" ) diff --git a/cli/command/manifest/cmd.go b/cli/command/manifest/cmd.go index ee254c918984..abeb6a851d49 100644 --- a/cli/command/manifest/cmd.go +++ b/cli/command/manifest/cmd.go @@ -3,9 +3,9 @@ package manifest import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/manifest/create_list.go b/cli/command/manifest/create_list.go index 3d8a6fed5f3f..286453554ae4 100644 --- a/cli/command/manifest/create_list.go +++ b/cli/command/manifest/create_list.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cli/command/manifest/create_test.go b/cli/command/manifest/create_test.go index 41c9b134d020..45d59919f3a3 100644 --- a/cli/command/manifest/create_test.go +++ b/cli/command/manifest/create_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/store" - manifesttypes "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/manifest/store" + manifesttypes "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" diff --git a/cli/command/manifest/inspect.go b/cli/command/manifest/inspect.go index b4beff387772..c124d65c3cf8 100644 --- a/cli/command/manifest/inspect.go +++ b/cli/command/manifest/inspect.go @@ -7,9 +7,9 @@ import ( "fmt" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/manifest/types" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/manifest/types" "github.com/docker/distribution/manifest/manifestlist" "github.com/spf13/cobra" ) diff --git a/cli/command/manifest/inspect_test.go b/cli/command/manifest/inspect_test.go index 83d6277bdb07..354f8fcc5654 100644 --- a/cli/command/manifest/inspect_test.go +++ b/cli/command/manifest/inspect_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/store" - "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/manifest/store" + "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/test" "github.com/docker/distribution" "github.com/docker/distribution/manifest/schema2" "github.com/opencontainers/go-digest" diff --git a/cli/command/manifest/push.go b/cli/command/manifest/push.go index 024bf6e025a2..2fa213331cc5 100644 --- a/cli/command/manifest/push.go +++ b/cli/command/manifest/push.go @@ -7,10 +7,10 @@ import ( "io" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/registryclient" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/registryclient" "github.com/docker/distribution" "github.com/docker/distribution/manifest/manifestlist" "github.com/docker/distribution/manifest/ocischema" diff --git a/cli/command/manifest/push_test.go b/cli/command/manifest/push_test.go index 3f747cc6f8eb..9a61e251cd35 100644 --- a/cli/command/manifest/push_test.go +++ b/cli/command/manifest/push_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/store" - manifesttypes "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/manifest/store" + manifesttypes "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/command/manifest/rm.go b/cli/command/manifest/rm.go index 38bb059e5ad4..a7ca0ae55aa9 100644 --- a/cli/command/manifest/rm.go +++ b/cli/command/manifest/rm.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - manifeststore "github.com/docker/cli/cli/manifest/store" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + manifeststore "github.com/docker/cli/v29/cli/manifest/store" "github.com/spf13/cobra" ) diff --git a/cli/command/manifest/rm_test.go b/cli/command/manifest/rm_test.go index 8d285c28c82a..03a4e3306176 100644 --- a/cli/command/manifest/rm_test.go +++ b/cli/command/manifest/rm_test.go @@ -4,8 +4,8 @@ import ( "io" "testing" - "github.com/docker/cli/cli/manifest/store" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/manifest/store" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/command/manifest/util.go b/cli/command/manifest/util.go index c10a98b0d8f4..895895ad4331 100644 --- a/cli/command/manifest/util.go +++ b/cli/command/manifest/util.go @@ -5,8 +5,8 @@ import ( "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/manifest/types" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/manifest/types" ) type osArch struct { diff --git a/cli/command/network/cmd.go b/cli/command/network/cmd.go index 7f4ec64e1f80..02548e6b48bb 100644 --- a/cli/command/network/cmd.go +++ b/cli/command/network/cmd.go @@ -1,9 +1,9 @@ package network import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/network/connect.go b/cli/command/network/connect.go index a629005f786b..01b2b9b6928b 100644 --- a/cli/command/network/connect.go +++ b/cli/command/network/connect.go @@ -7,10 +7,10 @@ import ( "net/netip" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/network/connect_test.go b/cli/command/network/connect_test.go index 52ede09412f7..d43bbdfa4a32 100644 --- a/cli/command/network/connect_test.go +++ b/cli/command/network/connect_test.go @@ -7,7 +7,7 @@ import ( "net/netip" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/command/network/create.go b/cli/command/network/create.go index cf676a4cea9b..a7d38d224d78 100644 --- a/cli/command/network/create.go +++ b/cli/command/network/create.go @@ -9,9 +9,9 @@ import ( "net/netip" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/network/create_test.go b/cli/command/network/create_test.go index dc5505023a78..d4829c0ef967 100644 --- a/cli/command/network/create_test.go +++ b/cli/command/network/create_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/command/network/disconnect.go b/cli/command/network/disconnect.go index f868df06f253..9d5a5ea2b32a 100644 --- a/cli/command/network/disconnect.go +++ b/cli/command/network/disconnect.go @@ -1,9 +1,9 @@ package network import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/network/disconnect_test.go b/cli/command/network/disconnect_test.go index d35d293f1c98..069d42d78728 100644 --- a/cli/command/network/disconnect_test.go +++ b/cli/command/network/disconnect_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" ) diff --git a/cli/command/network/formatter.go b/cli/command/network/formatter.go index 574de2d5f2cf..335d0b200b46 100644 --- a/cli/command/network/formatter.go +++ b/cli/command/network/formatter.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" ) diff --git a/cli/command/network/formatter_test.go b/cli/command/network/formatter_test.go index 6e870373feec..a93ad32e5f2e 100644 --- a/cli/command/network/formatter_test.go +++ b/cli/command/network/formatter_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/network/inspect.go b/cli/command/network/inspect.go index 1c27650f0c2b..4f4fbf5b2d2f 100644 --- a/cli/command/network/inspect.go +++ b/cli/command/network/inspect.go @@ -7,11 +7,11 @@ import ( "context" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/network/list.go b/cli/command/network/list.go index 9f2c90f4598a..a4f31937d595 100644 --- a/cli/command/network/list.go +++ b/cli/command/network/list.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/command/network/list_test.go b/cli/command/network/list_test.go index f6b52c0604e6..56d77ed64e19 100644 --- a/cli/command/network/list_test.go +++ b/cli/command/network/list_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/network/prune.go b/cli/command/network/prune.go index 2d7dc8571ce7..0090ada13db4 100644 --- a/cli/command/network/prune.go +++ b/cli/command/network/prune.go @@ -6,11 +6,11 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/network/prune_test.go b/cli/command/network/prune_test.go index 15b12b2966ce..29f5bf8d215f 100644 --- a/cli/command/network/prune_test.go +++ b/cli/command/network/prune_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" ) diff --git a/cli/command/network/remove.go b/cli/command/network/remove.go index 314039a6b352..4010002f36a7 100644 --- a/cli/command/network/remove.go +++ b/cli/command/network/remove.go @@ -6,10 +6,10 @@ import ( "strconv" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/prompt" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/prompt" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/network/remove_test.go b/cli/command/network/remove_test.go index c2d8cc7b587a..8ad5b09f41e2 100644 --- a/cli/command/network/remove_test.go +++ b/cli/command/network/remove_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/node/cmd.go b/cli/command/node/cmd.go index c86cce7632d2..744db63642c8 100644 --- a/cli/command/node/cmd.go +++ b/cli/command/node/cmd.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/node/completion.go b/cli/command/node/completion.go index 7fb7bdfb9834..92bb54f8e628 100644 --- a/cli/command/node/completion.go +++ b/cli/command/node/completion.go @@ -4,7 +4,7 @@ import ( "os" "strings" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/node/completion_test.go b/cli/command/node/completion_test.go index 13068319de26..5f0611c14f9d 100644 --- a/cli/command/node/completion_test.go +++ b/cli/command/node/completion_test.go @@ -3,7 +3,7 @@ package node import ( "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/cli/command/node/demote.go b/cli/command/node/demote.go index 1941c6f24151..377d9a1b8615 100644 --- a/cli/command/node/demote.go +++ b/cli/command/node/demote.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/swarm" "github.com/spf13/cobra" ) diff --git a/cli/command/node/demote_test.go b/cli/command/node/demote_test.go index 494de911e4a1..d5417178c5db 100644 --- a/cli/command/node/demote_test.go +++ b/cli/command/node/demote_test.go @@ -5,8 +5,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/node/formatter.go b/cli/command/node/formatter.go index a2eb419c1eaa..088c11a7fd3b 100644 --- a/cli/command/node/formatter.go +++ b/cli/command/node/formatter.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/inspect" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/inspect" "github.com/docker/go-units" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/node/formatter_test.go b/cli/command/node/formatter_test.go index a496fafec9a9..b4b6253f652e 100644 --- a/cli/command/node/formatter_test.go +++ b/cli/command/node/formatter_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/node/inspect.go b/cli/command/node/inspect.go index 1020c0eaf940..872dddf5c30b 100644 --- a/cli/command/node/inspect.go +++ b/cli/command/node/inspect.go @@ -8,10 +8,10 @@ import ( "errors" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/node/inspect_test.go b/cli/command/node/inspect_test.go index 1f07b6946f0a..4b17837dd01a 100644 --- a/cli/command/node/inspect_test.go +++ b/cli/command/node/inspect_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/node/list.go b/cli/command/node/list.go index 48e5641f2999..09ffa9a79144 100644 --- a/cli/command/node/list.go +++ b/cli/command/node/list.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/node/list_test.go b/cli/command/node/list_test.go index b2cc4611d118..e32d0ff52400 100644 --- a/cli/command/node/list_test.go +++ b/cli/command/node/list_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/node/opts.go b/cli/command/node/opts.go index e30e5de91005..673a7210e27f 100644 --- a/cli/command/node/opts.go +++ b/cli/command/node/opts.go @@ -1,7 +1,7 @@ package node import ( - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/opts" ) type nodeOptions struct { diff --git a/cli/command/node/promote.go b/cli/command/node/promote.go index fb4da49fef70..9ced505d50af 100644 --- a/cli/command/node/promote.go +++ b/cli/command/node/promote.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/swarm" "github.com/spf13/cobra" ) diff --git a/cli/command/node/promote_test.go b/cli/command/node/promote_test.go index d91169acc447..bc7c8b30b54b 100644 --- a/cli/command/node/promote_test.go +++ b/cli/command/node/promote_test.go @@ -5,8 +5,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/node/ps.go b/cli/command/node/ps.go index 1cd397883b74..0b995debd86f 100644 --- a/cli/command/node/ps.go +++ b/cli/command/node/ps.go @@ -4,11 +4,11 @@ import ( "context" "errors" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/command/task" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/cli/command/task" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/node/ps_test.go b/cli/command/node/ps_test.go index 16b93a21c816..a77a08e636d9 100644 --- a/cli/command/node/ps_test.go +++ b/cli/command/node/ps_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/node/remove.go b/cli/command/node/remove.go index 3d3d41354b00..45d8ee236d97 100644 --- a/cli/command/node/remove.go +++ b/cli/command/node/remove.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/node/remove_test.go b/cli/command/node/remove_test.go index 3a356953a05d..e9d9589880cb 100644 --- a/cli/command/node/remove_test.go +++ b/cli/command/node/remove_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" ) diff --git a/cli/command/node/update.go b/cli/command/node/update.go index a5f70e027430..9cba9f5c1463 100644 --- a/cli/command/node/update.go +++ b/cli/command/node/update.go @@ -9,10 +9,10 @@ import ( "fmt" "maps" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/node/update_test.go b/cli/command/node/update_test.go index 2ce4b65934b3..44ecea12c681 100644 --- a/cli/command/node/update_test.go +++ b/cli/command/node/update_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/plugin/cmd.go b/cli/command/plugin/cmd.go index 653e163d88c7..6e62164ef1f0 100644 --- a/cli/command/plugin/cmd.go +++ b/cli/command/plugin/cmd.go @@ -1,9 +1,9 @@ package plugin import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/completion.go b/cli/command/plugin/completion.go index 0149d5368684..d1540016113c 100644 --- a/cli/command/plugin/completion.go +++ b/cli/command/plugin/completion.go @@ -1,7 +1,7 @@ package plugin import ( - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/create.go b/cli/command/plugin/create.go index 6d087612fb55..c394eee6ce15 100644 --- a/cli/command/plugin/create.go +++ b/cli/command/plugin/create.go @@ -9,8 +9,8 @@ import ( "path/filepath" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/go-archive" "github.com/moby/go-archive/compression" "github.com/moby/moby/api/types/plugin" diff --git a/cli/command/plugin/create_test.go b/cli/command/plugin/create_test.go index 871ec4328a2f..3216eec1efd3 100644 --- a/cli/command/plugin/create_test.go +++ b/cli/command/plugin/create_test.go @@ -6,7 +6,7 @@ import ( "runtime" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/plugin/disable.go b/cli/command/plugin/disable.go index 54ecc176c236..391e5d133769 100644 --- a/cli/command/plugin/disable.go +++ b/cli/command/plugin/disable.go @@ -3,8 +3,8 @@ package plugin import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/disable_test.go b/cli/command/plugin/disable_test.go index 480a100d8997..822d470bc5ef 100644 --- a/cli/command/plugin/disable_test.go +++ b/cli/command/plugin/disable_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/plugin/enable.go b/cli/command/plugin/enable.go index 65c67906631b..cb61c3e79316 100644 --- a/cli/command/plugin/enable.go +++ b/cli/command/plugin/enable.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/enable_test.go b/cli/command/plugin/enable_test.go index f74ca5832977..722396a847b9 100644 --- a/cli/command/plugin/enable_test.go +++ b/cli/command/plugin/enable_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/plugin/formatter.go b/cli/command/plugin/formatter.go index 283f3df283ff..4d99b66061f0 100644 --- a/cli/command/plugin/formatter.go +++ b/cli/command/plugin/formatter.go @@ -3,7 +3,7 @@ package plugin import ( "strings" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" ) diff --git a/cli/command/plugin/formatter_test.go b/cli/command/plugin/formatter_test.go index 3c8584605419..8b35c2e6f0ac 100644 --- a/cli/command/plugin/formatter_test.go +++ b/cli/command/plugin/formatter_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/plugin/inspect.go b/cli/command/plugin/inspect.go index ed45605dc137..331422dc844a 100644 --- a/cli/command/plugin/inspect.go +++ b/cli/command/plugin/inspect.go @@ -6,10 +6,10 @@ package plugin import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/inspect_test.go b/cli/command/plugin/inspect_test.go index 1b3d7f44668f..60508bf6678a 100644 --- a/cli/command/plugin/inspect_test.go +++ b/cli/command/plugin/inspect_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/plugin/install.go b/cli/command/plugin/install.go index 7d2d9aafaeb0..d842122803ae 100644 --- a/cli/command/plugin/install.go +++ b/cli/command/plugin/install.go @@ -5,10 +5,10 @@ import ( "fmt" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/jsonstream" - "github.com/docker/cli/internal/prompt" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/jsonstream" + "github.com/docker/cli/v29/internal/prompt" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/plugin/install_test.go b/cli/command/plugin/install_test.go index c1c9025037e3..7f7aded1c9a3 100644 --- a/cli/command/plugin/install_test.go +++ b/cli/command/plugin/install_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/plugin/list.go b/cli/command/plugin/list.go index 3606ac5bbfb4..edb0aadcee7f 100644 --- a/cli/command/plugin/list.go +++ b/cli/command/plugin/list.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" diff --git a/cli/command/plugin/list_test.go b/cli/command/plugin/list_test.go index cad31ad80dd8..4758be721220 100644 --- a/cli/command/plugin/list_test.go +++ b/cli/command/plugin/list_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" diff --git a/cli/command/plugin/push.go b/cli/command/plugin/push.go index af76db49ebef..de2814b4832d 100644 --- a/cli/command/plugin/push.go +++ b/cli/command/plugin/push.go @@ -5,9 +5,9 @@ import ( "fmt" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/jsonstream" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/remove.go b/cli/command/plugin/remove.go index c10636616ef9..10a22eb890a5 100644 --- a/cli/command/plugin/remove.go +++ b/cli/command/plugin/remove.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/remove_test.go b/cli/command/plugin/remove_test.go index 61e4c82afbb5..6779281230f6 100644 --- a/cli/command/plugin/remove_test.go +++ b/cli/command/plugin/remove_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/plugin/set.go b/cli/command/plugin/set.go index 21b517d8a301..849b04bc1048 100644 --- a/cli/command/plugin/set.go +++ b/cli/command/plugin/set.go @@ -1,8 +1,8 @@ package plugin import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/upgrade.go b/cli/command/plugin/upgrade.go index 9053ce6e8980..13452e1c6cfa 100644 --- a/cli/command/plugin/upgrade.go +++ b/cli/command/plugin/upgrade.go @@ -6,10 +6,10 @@ import ( "fmt" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/jsonstream" - "github.com/docker/cli/internal/prompt" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/jsonstream" + "github.com/docker/cli/v29/internal/prompt" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/plugin/upgrade_test.go b/cli/command/plugin/upgrade_test.go index 0eb8f98bb712..eaa61f87389c 100644 --- a/cli/command/plugin/upgrade_test.go +++ b/cli/command/plugin/upgrade_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/plugin" "github.com/moby/moby/client" "gotest.tools/v3/golden" diff --git a/cli/command/registry.go b/cli/command/registry.go index 2e767d5b72f3..6a2495679607 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -9,13 +9,13 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/config/credentials" - configtypes "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/cli/hints" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/credentials" + configtypes "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/cli/hints" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/internal/tui" "github.com/moby/moby/api/pkg/authconfig" registrytypes "github.com/moby/moby/api/types/registry" "github.com/morikuni/aec" diff --git a/cli/command/registry/formatter_search.go b/cli/command/registry/formatter_search.go index 6be72269e382..f528735671a9 100644 --- a/cli/command/registry/formatter_search.go +++ b/cli/command/registry/formatter_search.go @@ -4,7 +4,7 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/client" ) diff --git a/cli/command/registry/formatter_search_test.go b/cli/command/registry/formatter_search_test.go index 70787c9e90c6..2c74d147ba16 100644 --- a/cli/command/registry/formatter_search_test.go +++ b/cli/command/registry/formatter_search_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/registry/login.go b/cli/command/registry/login.go index 471e73f8238e..32c9e2c8eceb 100644 --- a/cli/command/registry/login.go +++ b/cli/command/registry/login.go @@ -9,14 +9,14 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - configtypes "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/internal/commands" - "github.com/docker/cli/internal/oauth/manager" - "github.com/docker/cli/internal/registry" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + configtypes "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/internal/commands" + "github.com/docker/cli/v29/internal/oauth/manager" + "github.com/docker/cli/v29/internal/registry" + "github.com/docker/cli/v29/internal/tui" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/registry/login_test.go b/cli/command/registry/login_test.go index 32d0e6f8cf7c..53363f0f095f 100644 --- a/cli/command/registry/login_test.go +++ b/cli/command/registry/login_test.go @@ -12,12 +12,12 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/cli/config/configfile" - configtypes "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/internal/registry" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/config/configfile" + configtypes "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/internal/registry" + "github.com/docker/cli/v29/internal/test" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/registry/logout.go b/cli/command/registry/logout.go index 16218f67d9a7..06d447fc0ae5 100644 --- a/cli/command/registry/logout.go +++ b/cli/command/registry/logout.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/internal/commands" - "github.com/docker/cli/internal/oauth/manager" - "github.com/docker/cli/internal/registry" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/internal/commands" + "github.com/docker/cli/v29/internal/oauth/manager" + "github.com/docker/cli/v29/internal/registry" "github.com/spf13/cobra" ) diff --git a/cli/command/registry/search.go b/cli/command/registry/search.go index a99631758ad2..e03d94d1e982 100644 --- a/cli/command/registry/search.go +++ b/cli/command/registry/search.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/internal/commands" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/internal/commands" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/pkg/authconfig" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/client" diff --git a/cli/command/registry/warning.go b/cli/command/registry/warning.go index 22a8c8655be6..3878a041d65d 100644 --- a/cli/command/registry/warning.go +++ b/cli/command/registry/warning.go @@ -3,9 +3,9 @@ package registry import ( "os" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/tui" ) // maybePrintEnvAuthWarning if the `DOCKER_AUTH_CONFIG` environment variable is diff --git a/cli/command/registry_test.go b/cli/command/registry_test.go index 751711f36391..fa8e863266f8 100644 --- a/cli/command/registry_test.go +++ b/cli/command/registry_test.go @@ -6,9 +6,9 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - configtypes "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + configtypes "github.com/docker/cli/v29/cli/config/types" "github.com/moby/moby/api/pkg/authconfig" "github.com/moby/moby/api/types/registry" "gotest.tools/v3/assert" diff --git a/cli/command/secret/cmd.go b/cli/command/secret/cmd.go index 7ff0e369489d..e1ef5adb1f97 100644 --- a/cli/command/secret/cmd.go +++ b/cli/command/secret/cmd.go @@ -1,10 +1,10 @@ package secret import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/commands" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/secret/create.go b/cli/command/secret/create.go index c6ecfa23eec1..50d7e18c9133 100644 --- a/cli/command/secret/create.go +++ b/cli/command/secret/create.go @@ -6,9 +6,9 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/moby/sys/sequential" diff --git a/cli/command/secret/create_test.go b/cli/command/secret/create_test.go index 4456b0f7f354..b7e64e7ce5ab 100644 --- a/cli/command/secret/create_test.go +++ b/cli/command/secret/create_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/secret/formatter.go b/cli/command/secret/formatter.go index 9788f1ce1ecc..9ebb3febe61e 100644 --- a/cli/command/secret/formatter.go +++ b/cli/command/secret/formatter.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/inspect" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/inspect" "github.com/docker/go-units" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/secret/formatter_test.go b/cli/command/secret/formatter_test.go index 4a3ac1daa6c5..4aecc17ef733 100644 --- a/cli/command/secret/formatter_test.go +++ b/cli/command/secret/formatter_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/secret/inspect.go b/cli/command/secret/inspect.go index 6f614c3d3015..d8add51b847e 100644 --- a/cli/command/secret/inspect.go +++ b/cli/command/secret/inspect.go @@ -8,10 +8,10 @@ import ( "errors" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/secret/inspect_test.go b/cli/command/secret/inspect_test.go index a46d02230f65..d146979ddc6c 100644 --- a/cli/command/secret/inspect_test.go +++ b/cli/command/secret/inspect_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/cli/command/secret/ls.go b/cli/command/secret/ls.go index 999ea53e38b3..819303d6d9ce 100644 --- a/cli/command/secret/ls.go +++ b/cli/command/secret/ls.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/secret/ls_test.go b/cli/command/secret/ls_test.go index d8476894791a..3e141e74d924 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/secret/remove.go b/cli/command/secret/remove.go index 24df99cfc973..33ed23e10170 100644 --- a/cli/command/secret/remove.go +++ b/cli/command/secret/remove.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/secret/remove_test.go b/cli/command/secret/remove_test.go index 84535b756419..cb4aa8189eb9 100644 --- a/cli/command/secret/remove_test.go +++ b/cli/command/secret/remove_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/service/client_test.go b/cli/command/service/client_test.go index 6e73940a8887..cd7d2c8e5056 100644 --- a/cli/command/service/client_test.go +++ b/cli/command/service/client_test.go @@ -3,7 +3,7 @@ package service import ( "context" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" ) diff --git a/cli/command/service/cmd.go b/cli/command/service/cmd.go index 1620edc19f43..4484e6925393 100644 --- a/cli/command/service/cmd.go +++ b/cli/command/service/cmd.go @@ -1,9 +1,9 @@ package service import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/service/completion.go b/cli/command/service/completion.go index 6d5438c2cd83..cff0616fae0a 100644 --- a/cli/command/service/completion.go +++ b/cli/command/service/completion.go @@ -4,7 +4,7 @@ import ( "os" "strings" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/service/completion_test.go b/cli/command/service/completion_test.go index 9df2580f8a41..7d6a1658b710 100644 --- a/cli/command/service/completion_test.go +++ b/cli/command/service/completion_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/service/create.go b/cli/command/service/create.go index 45406d7b2633..fc61d021feeb 100644 --- a/cli/command/service/create.go +++ b/cli/command/service/create.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - cliopts "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + cliopts "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/service/create_test.go b/cli/command/service/create_test.go index 9b4e9ddd83ea..da17b0e33dd0 100644 --- a/cli/command/service/create_test.go +++ b/cli/command/service/create_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/docker/cli/opts/swarmopts" + "github.com/docker/cli/v29/opts/swarmopts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/service/formatter.go b/cli/command/service/formatter.go index 4440f6165dce..4cd7e0552752 100644 --- a/cli/command/service/formatter.go +++ b/cli/command/service/formatter.go @@ -13,8 +13,8 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/inspect" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/inspect" "github.com/docker/go-units" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/container" diff --git a/cli/command/service/formatter_test.go b/cli/command/service/formatter_test.go index 024c827ec806..a8170ca4f614 100644 --- a/cli/command/service/formatter_test.go +++ b/cli/command/service/formatter_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/service/generic_resource_opts.go b/cli/command/service/generic_resource_opts.go index 426b44d1581b..1caa60e86c3b 100644 --- a/cli/command/service/generic_resource_opts.go +++ b/cli/command/service/generic_resource_opts.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli/command/service/internal/genericresource" + "github.com/docker/cli/v29/cli/command/service/internal/genericresource" "github.com/moby/moby/api/types/swarm" ) diff --git a/cli/command/service/helpers.go b/cli/command/service/helpers.go index 2abe4ae7d22f..d36eb1382639 100644 --- a/cli/command/service/helpers.go +++ b/cli/command/service/helpers.go @@ -4,9 +4,9 @@ import ( "context" "io" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/service/progress" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/service/progress" + "github.com/docker/cli/v29/internal/jsonstream" ) // WaitOnService waits for the service to converge. It outputs a progress bar, diff --git a/cli/command/service/inspect.go b/cli/command/service/inspect.go index 7e56b317c846..dacf3dec7957 100644 --- a/cli/command/service/inspect.go +++ b/cli/command/service/inspect.go @@ -10,10 +10,10 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/inspect_test.go b/cli/command/service/inspect_test.go index 2155934cc466..fd36d9bef3cc 100644 --- a/cli/command/service/inspect_test.go +++ b/cli/command/service/inspect_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" diff --git a/cli/command/service/list.go b/cli/command/service/list.go index 346eb6651f59..31f36898b48d 100644 --- a/cli/command/service/list.go +++ b/cli/command/service/list.go @@ -3,11 +3,11 @@ package service import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/list_test.go b/cli/command/service/list_test.go index 7a2cf5da1dd6..52fbe3e94a9f 100644 --- a/cli/command/service/list_test.go +++ b/cli/command/service/list_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/service/logs.go b/cli/command/service/logs.go index 79908b865758..d410c7a3299e 100644 --- a/cli/command/service/logs.go +++ b/cli/command/service/logs.go @@ -14,11 +14,11 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/internal/logdetails" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/internal/logdetails" "github.com/moby/moby/api/pkg/stdcopy" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/service/opts.go b/cli/command/service/opts.go index e2758e64cd7d..b53f6652a042 100644 --- a/cli/command/service/opts.go +++ b/cli/command/service/opts.go @@ -14,8 +14,8 @@ import ( "strings" "time" - "github.com/docker/cli/opts" - "github.com/docker/cli/opts/swarmopts" + "github.com/docker/cli/v29/opts" + "github.com/docker/cli/v29/opts/swarmopts" gogotypes "github.com/gogo/protobuf/types" "github.com/google/shlex" "github.com/moby/moby/api/types/container" diff --git a/cli/command/service/opts_test.go b/cli/command/service/opts_test.go index 5ab11e262b36..0f5c06860ff4 100644 --- a/cli/command/service/opts_test.go +++ b/cli/command/service/opts_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" diff --git a/cli/command/service/progress/progress.go b/cli/command/service/progress/progress.go index ef191fce33ac..691f127a9d50 100644 --- a/cli/command/service/progress/progress.go +++ b/cli/command/service/progress/progress.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/moby/moby/client/pkg/progress" diff --git a/cli/command/service/ps.go b/cli/command/service/ps.go index 791949184cd4..1cf96eeaef24 100644 --- a/cli/command/service/ps.go +++ b/cli/command/service/ps.go @@ -5,12 +5,12 @@ import ( "errors" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/command/node" - "github.com/docker/cli/cli/command/task" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/cli/command/node" + "github.com/docker/cli/v29/cli/command/task" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/ps_test.go b/cli/command/service/ps_test.go index 0833d64a768e..daa230831568 100644 --- a/cli/command/service/ps_test.go +++ b/cli/command/service/ps_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/service/remove.go b/cli/command/service/remove.go index 56ca7482cd91..16db2335738e 100644 --- a/cli/command/service/remove.go +++ b/cli/command/service/remove.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/rollback.go b/cli/command/service/rollback.go index e3ca98e2385a..92bd89f5ac7d 100644 --- a/cli/command/service/rollback.go +++ b/cli/command/service/rollback.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/rollback_test.go b/cli/command/service/rollback_test.go index 19842888bad0..815844ce827b 100644 --- a/cli/command/service/rollback_test.go +++ b/cli/command/service/rollback_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/service/scale.go b/cli/command/service/scale.go index a2555ab98f7f..fe1c379332b2 100644 --- a/cli/command/service/scale.go +++ b/cli/command/service/scale.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/service/update.go b/cli/command/service/update.go index 2e7a0ee25fce..e70e1590f732 100644 --- a/cli/command/service/update.go +++ b/cli/command/service/update.go @@ -14,11 +14,11 @@ import ( "strings" "time" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/opts" - "github.com/docker/cli/opts/swarmopts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/opts" + "github.com/docker/cli/v29/opts/swarmopts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/mount" "github.com/moby/moby/api/types/network" diff --git a/cli/command/stack/client_test.go b/cli/command/stack/client_test.go index 9c308c700776..0b2d7281ab0c 100644 --- a/cli/command/stack/client_test.go +++ b/cli/command/stack/client_test.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/docker/cli/cli/compose/convert" + "github.com/docker/cli/v29/cli/compose/convert" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/stack/cmd.go b/cli/command/stack/cmd.go index 45c0e8803eba..67373465d006 100644 --- a/cli/command/stack/cmd.go +++ b/cli/command/stack/cmd.go @@ -3,10 +3,10 @@ package stack import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/stack/common.go b/cli/command/stack/common.go index 29f41acd631d..b799df764db6 100644 --- a/cli/command/stack/common.go +++ b/cli/command/stack/common.go @@ -6,8 +6,8 @@ import ( "strings" "unicode" - "github.com/docker/cli/cli/compose/convert" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli/compose/convert" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" ) diff --git a/cli/command/stack/config.go b/cli/command/stack/config.go index ebcbb3f2511e..c751e5023363 100644 --- a/cli/command/stack/config.go +++ b/cli/command/stack/config.go @@ -4,10 +4,10 @@ import ( "bytes" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - composeLoader "github.com/docker/cli/cli/compose/loader" - composetypes "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + composeLoader "github.com/docker/cli/v29/cli/compose/loader" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/spf13/cobra" "go.yaml.in/yaml/v3" ) diff --git a/cli/command/stack/config_test.go b/cli/command/stack/config_test.go index b4243567e709..0ab443ccc36b 100644 --- a/cli/command/stack/config_test.go +++ b/cli/command/stack/config_test.go @@ -4,9 +4,9 @@ import ( "io" "testing" - "github.com/docker/cli/cli/compose/loader" - composetypes "github.com/docker/cli/cli/compose/types" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/compose/loader" + composetypes "github.com/docker/cli/v29/cli/compose/types" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/command/stack/deploy.go b/cli/command/stack/deploy.go index 2e8a2b09530a..d285f428e467 100644 --- a/cli/command/stack/deploy.go +++ b/cli/command/stack/deploy.go @@ -5,10 +5,10 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/compose/convert" - composetypes "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/compose/convert" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/stack/deploy_composefile.go b/cli/command/stack/deploy_composefile.go index ad85765133cb..4ca753a9af30 100644 --- a/cli/command/stack/deploy_composefile.go +++ b/cli/command/stack/deploy_composefile.go @@ -6,10 +6,10 @@ import ( "fmt" "github.com/containerd/errdefs" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/service" - "github.com/docker/cli/cli/compose/convert" - composetypes "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/service" + "github.com/docker/cli/v29/cli/compose/convert" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" diff --git a/cli/command/stack/deploy_composefile_test.go b/cli/command/stack/deploy_composefile_test.go index 4a5d9963c621..0c3997c3d298 100644 --- a/cli/command/stack/deploy_composefile_test.go +++ b/cli/command/stack/deploy_composefile_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "github.com/docker/cli/internal/test/network" + "github.com/docker/cli/v29/internal/test/network" networktypes "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/stack/deploy_test.go b/cli/command/stack/deploy_test.go index a0fb1fd0c4c2..36102542a03f 100644 --- a/cli/command/stack/deploy_test.go +++ b/cli/command/stack/deploy_test.go @@ -5,8 +5,8 @@ import ( "io" "testing" - "github.com/docker/cli/cli/compose/convert" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/compose/convert" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/stack/list.go b/cli/command/stack/list.go index 8463bd551571..ed361f34ec4e 100644 --- a/cli/command/stack/list.go +++ b/cli/command/stack/list.go @@ -7,10 +7,10 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" ) diff --git a/cli/command/stack/list_formatter.go b/cli/command/stack/list_formatter.go index 1aa4f97e07b4..2b3a0daf261c 100644 --- a/cli/command/stack/list_formatter.go +++ b/cli/command/stack/list_formatter.go @@ -3,7 +3,7 @@ package stack import ( "strconv" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" ) // stackTableFormat is the default Swarm stack format diff --git a/cli/command/stack/list_formatter_test.go b/cli/command/stack/list_formatter_test.go index 99dcd43d4bc4..d3b5d8a8144d 100644 --- a/cli/command/stack/list_formatter_test.go +++ b/cli/command/stack/list_formatter_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "gotest.tools/v3/assert" ) diff --git a/cli/command/stack/list_test.go b/cli/command/stack/list_test.go index e194a8acc477..7be598118b13 100644 --- a/cli/command/stack/list_test.go +++ b/cli/command/stack/list_test.go @@ -5,8 +5,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/stack/list_utils.go b/cli/command/stack/list_utils.go index cbf42b3dab50..3de053df46db 100644 --- a/cli/command/stack/list_utils.go +++ b/cli/command/stack/list_utils.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/docker/cli/cli/compose/convert" + "github.com/docker/cli/v29/cli/compose/convert" "github.com/moby/moby/client" ) diff --git a/cli/command/stack/loader.go b/cli/command/stack/loader.go index 10579a08d89d..9b32f35268d3 100644 --- a/cli/command/stack/loader.go +++ b/cli/command/stack/loader.go @@ -14,10 +14,10 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/compose/loader" - "github.com/docker/cli/cli/compose/schema" - composetypes "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/compose/loader" + "github.com/docker/cli/v29/cli/compose/schema" + composetypes "github.com/docker/cli/v29/cli/compose/types" ) // loadComposeFile parse the composefile specified in the cli and returns its configOptions and version. diff --git a/cli/command/stack/ps.go b/cli/command/stack/ps.go index 7fb21af72e17..3d48c6e51a78 100644 --- a/cli/command/stack/ps.go +++ b/cli/command/stack/ps.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/command/task" - flagsHelper "github.com/docker/cli/cli/flags" - cliopts "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/cli/command/task" + flagsHelper "github.com/docker/cli/v29/cli/flags" + cliopts "github.com/docker/cli/v29/opts" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/stack/ps_test.go b/cli/command/stack/ps_test.go index d3098a907468..3f3b40b61269 100644 --- a/cli/command/stack/ps_test.go +++ b/cli/command/stack/ps_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/stack/remove.go b/cli/command/stack/remove.go index 2f6d061b35b6..1722fb67565d 100644 --- a/cli/command/stack/remove.go +++ b/cli/command/stack/remove.go @@ -10,8 +10,8 @@ import ( "fmt" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/stack/remove_test.go b/cli/command/stack/remove_test.go index 16c6675e4c0d..8bf7ef2b271a 100644 --- a/cli/command/stack/remove_test.go +++ b/cli/command/stack/remove_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/stack/services.go b/cli/command/stack/services.go index 49bf573da7c1..62dbdffbed74 100644 --- a/cli/command/stack/services.go +++ b/cli/command/stack/services.go @@ -8,12 +8,12 @@ import ( "fmt" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/service" - flagsHelper "github.com/docker/cli/cli/flags" - cliopts "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/service" + flagsHelper "github.com/docker/cli/v29/cli/flags" + cliopts "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/stack/services_test.go b/cli/command/stack/services_test.go index c7ee85df06ac..95c146fd2619 100644 --- a/cli/command/stack/services_test.go +++ b/cli/command/stack/services_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/swarm/ca.go b/cli/command/swarm/ca.go index 749afd860de5..78b4af934951 100644 --- a/cli/command/swarm/ca.go +++ b/cli/command/swarm/ca.go @@ -7,10 +7,10 @@ import ( "io" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/swarm/progress" - "github.com/docker/cli/internal/jsonstream" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/swarm/progress" + "github.com/docker/cli/v29/internal/jsonstream" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index 870f9b49f24b..c86cbf590231 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/swarm/cmd.go b/cli/command/swarm/cmd.go index 72d873aadfb9..5f2339b43211 100644 --- a/cli/command/swarm/cmd.go +++ b/cli/command/swarm/cmd.go @@ -3,9 +3,9 @@ package swarm import ( "github.com/spf13/cobra" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" ) func init() { diff --git a/cli/command/swarm/init.go b/cli/command/swarm/init.go index e977e4e71479..2d6a2f5a70b7 100644 --- a/cli/command/swarm/init.go +++ b/cli/command/swarm/init.go @@ -7,8 +7,8 @@ import ( "net/netip" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/swarm/init_test.go b/cli/command/swarm/init_test.go index a524d9932efc..2e792016d28e 100644 --- a/cli/command/swarm/init_test.go +++ b/cli/command/swarm/init_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/swarm/join.go b/cli/command/swarm/join.go index 3fd68fe9daf5..05d808eb2287 100644 --- a/cli/command/swarm/join.go +++ b/cli/command/swarm/join.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/swarm/join_test.go b/cli/command/swarm/join_test.go index 707b2cb28bec..02fc9b9840cd 100644 --- a/cli/command/swarm/join_test.go +++ b/cli/command/swarm/join_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/swarm/join_token.go b/cli/command/swarm/join_token.go index a1c01ec3c988..7cb414e49df1 100644 --- a/cli/command/swarm/join_token.go +++ b/cli/command/swarm/join_token.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/swarm/join_token_test.go b/cli/command/swarm/join_token_test.go index b2ac55c675a9..a1c93db9cd62 100644 --- a/cli/command/swarm/join_token_test.go +++ b/cli/command/swarm/join_token_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/swarm/leave.go b/cli/command/swarm/leave.go index 36c529d696d1..645cbeb50149 100644 --- a/cli/command/swarm/leave.go +++ b/cli/command/swarm/leave.go @@ -3,8 +3,8 @@ package swarm import ( "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/swarm/leave_test.go b/cli/command/swarm/leave_test.go index 72b828beae66..6a3298ea0a75 100644 --- a/cli/command/swarm/leave_test.go +++ b/cli/command/swarm/leave_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/command/swarm/opts.go b/cli/command/swarm/opts.go index 1aa90e757bac..87401b4b52de 100644 --- a/cli/command/swarm/opts.go +++ b/cli/command/swarm/opts.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/swarm" "github.com/spf13/pflag" ) diff --git a/cli/command/swarm/unlock.go b/cli/command/swarm/unlock.go index bf15ed2868c7..262b6ac0fab6 100644 --- a/cli/command/swarm/unlock.go +++ b/cli/command/swarm/unlock.go @@ -8,9 +8,9 @@ import ( "io" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/swarm/unlock_key.go b/cli/command/swarm/unlock_key.go index a8df5089e5c9..362ee4d1596f 100644 --- a/cli/command/swarm/unlock_key.go +++ b/cli/command/swarm/unlock_key.go @@ -6,8 +6,8 @@ import ( "fmt" "io" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/swarm/unlock_key_test.go b/cli/command/swarm/unlock_key_test.go index 4f6348116096..530c538cf5cc 100644 --- a/cli/command/swarm/unlock_key_test.go +++ b/cli/command/swarm/unlock_key_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/cli/command/swarm/unlock_test.go b/cli/command/swarm/unlock_test.go index f71bd1ba8c0b..2140632ffc18 100644 --- a/cli/command/swarm/unlock_test.go +++ b/cli/command/swarm/unlock_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" diff --git a/cli/command/swarm/update.go b/cli/command/swarm/update.go index 9dc373211a34..a6eff1558d5c 100644 --- a/cli/command/swarm/update.go +++ b/cli/command/swarm/update.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/cli/command/swarm/update_test.go b/cli/command/swarm/update_test.go index c611b269f929..f23fbfdb491f 100644 --- a/cli/command/swarm/update_test.go +++ b/cli/command/swarm/update_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/golden" diff --git a/cli/command/system/cmd.go b/cli/command/system/cmd.go index 793b997eb57e..3bbc7ccc5fde 100644 --- a/cli/command/system/cmd.go +++ b/cli/command/system/cmd.go @@ -1,9 +1,9 @@ package system import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/system/completion.go b/cli/command/system/completion.go index 058dd4b29a1f..639cdb845df2 100644 --- a/cli/command/system/completion.go +++ b/cli/command/system/completion.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/idresolver" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/idresolver" "github.com/moby/moby/api/types/events" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/system/completion_test.go b/cli/command/system/completion_test.go index 0095ce598e62..664e4b0fc77d 100644 --- a/cli/command/system/completion_test.go +++ b/cli/command/system/completion_test.go @@ -6,8 +6,8 @@ import ( "fmt" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/network" diff --git a/cli/command/system/df.go b/cli/command/system/df.go index 2c689da0206d..9304876d6098 100644 --- a/cli/command/system/df.go +++ b/cli/command/system/df.go @@ -3,10 +3,10 @@ package system import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/system/dial_stdio.go b/cli/command/system/dial_stdio.go index 62206af0edd8..7f58749158a8 100644 --- a/cli/command/system/dial_stdio.go +++ b/cli/command/system/dial_stdio.go @@ -7,8 +7,8 @@ import ( "io" "os" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/cli/command/system/events.go b/cli/command/system/events.go index 36264ef010d9..351450f6bfca 100644 --- a/cli/command/system/events.go +++ b/cli/command/system/events.go @@ -13,12 +13,12 @@ import ( "text/template" "time" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" + "github.com/docker/cli/v29/templates" "github.com/moby/moby/api/types/events" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/system/events_test.go b/cli/command/system/events_test.go index cda6e54ecc60..a41c4cd2ab27 100644 --- a/cli/command/system/events_test.go +++ b/cli/command/system/events_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/events" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/system/info.go b/cli/command/system/info.go index fcc533c4265d..e4e3ec37bb7f 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -11,15 +11,15 @@ import ( "slices" "strings" - "github.com/docker/cli/cli" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/debug" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/internal/lazyregexp" - "github.com/docker/cli/internal/registry" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/debug" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/internal/lazyregexp" + "github.com/docker/cli/v29/internal/registry" + "github.com/docker/cli/v29/templates" "github.com/docker/go-units" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" diff --git a/cli/command/system/info_test.go b/cli/command/system/info_test.go index 56d587a69fff..6fbb7951888b 100644 --- a/cli/command/system/info_test.go +++ b/cli/command/system/info_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/internal/test" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/internal/test" registrytypes "github.com/moby/moby/api/types/registry" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/system" diff --git a/cli/command/system/inspect.go b/cli/command/system/inspect.go index 1912400068ce..ee70a4af7f02 100644 --- a/cli/command/system/inspect.go +++ b/cli/command/system/inspect.go @@ -10,11 +10,11 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/system/inspect_test.go b/cli/command/system/inspect_test.go index 3fbadc7f6d0f..aefd49e39944 100644 --- a/cli/command/system/inspect_test.go +++ b/cli/command/system/inspect_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/command/system/prune.go b/cli/command/system/prune.go index 33544bf5b52c..58a96f017bc4 100644 --- a/cli/command/system/prune.go +++ b/cli/command/system/prune.go @@ -12,11 +12,11 @@ import ( "text/template" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/docker/go-units" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" diff --git a/cli/command/system/prune_test.go b/cli/command/system/prune_test.go index 9bf66c0337b1..c4bcc215c869 100644 --- a/cli/command/system/prune_test.go +++ b/cli/command/system/prune_test.go @@ -6,18 +6,18 @@ import ( "io" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" // Make sure pruners are registered for tests (they're included automatically when building). - _ "github.com/docker/cli/cli/command/builder" - _ "github.com/docker/cli/cli/command/container" - _ "github.com/docker/cli/cli/command/image" - _ "github.com/docker/cli/cli/command/network" - _ "github.com/docker/cli/cli/command/volume" + _ "github.com/docker/cli/v29/cli/command/builder" + _ "github.com/docker/cli/v29/cli/command/container" + _ "github.com/docker/cli/v29/cli/command/image" + _ "github.com/docker/cli/v29/cli/command/network" + _ "github.com/docker/cli/v29/cli/command/volume" ) func TestPrunePromptFilters(t *testing.T) { diff --git a/cli/command/system/pruner/pruner.go b/cli/command/system/pruner/pruner.go index 1ff393c5f083..8e59b8005474 100644 --- a/cli/command/system/pruner/pruner.go +++ b/cli/command/system/pruner/pruner.go @@ -13,8 +13,8 @@ import ( "maps" "slices" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" ) // ContentType is an identifier for content that can be pruned. diff --git a/cli/command/system/version.go b/cli/command/system/version.go index 41b7de87c9e7..80fe30ea652b 100644 --- a/cli/command/system/version.go +++ b/cli/command/system/version.go @@ -14,13 +14,13 @@ import ( "text/template" "time" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/formatter/tabwriter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/cli/version" - "github.com/docker/cli/templates" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter/tabwriter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/cli/version" + "github.com/docker/cli/v29/templates" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/system/version_test.go b/cli/command/system/version_test.go index b82693185b88..ac130e5e2b46 100644 --- a/cli/command/system/version_test.go +++ b/cli/command/system/version_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/task/formatter.go b/cli/command/task/formatter.go index cbe8c00d8dc4..e79ffa04e0c6 100644 --- a/cli/command/task/formatter.go +++ b/cli/command/task/formatter.go @@ -6,7 +6,7 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/docker/go-units" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/task/formatter_test.go b/cli/command/task/formatter_test.go index 278e072efdb6..d5653d793110 100644 --- a/cli/command/task/formatter_test.go +++ b/cli/command/task/formatter_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/task/print.go b/cli/command/task/print.go index 846a293cdcce..baa4ca733241 100644 --- a/cli/command/task/print.go +++ b/cli/command/task/print.go @@ -9,10 +9,10 @@ import ( "fmt" "slices" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/config/configfile" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/cli/config/configfile" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/command/task/print_test.go b/cli/command/task/print_test.go index 7c3281e803fe..0b6620211681 100644 --- a/cli/command/task/print_test.go +++ b/cli/command/task/print_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - "github.com/docker/cli/cli/command/formatter" - "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/idresolver" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/telemetry_utils.go b/cli/command/telemetry_utils.go index 179177c02bcc..2b3655dc718f 100644 --- a/cli/command/telemetry_utils.go +++ b/cli/command/telemetry_utils.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/docker/cli/cli/version" + "github.com/docker/cli/v29/cli/version" "github.com/spf13/cobra" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" diff --git a/cli/command/telemetry_utils_test.go b/cli/command/telemetry_utils_test.go index 39c1dace604d..4be09af6f105 100644 --- a/cli/command/telemetry_utils_test.go +++ b/cli/command/telemetry_utils_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/cobra" "go.opentelemetry.io/otel/attribute" diff --git a/cli/command/utils.go b/cli/command/utils.go index 1bee68cec5de..530b669663d4 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "github.com/moby/moby/client" ) diff --git a/cli/command/utils_test.go b/cli/command/utils_test.go index 6c8d484c6a53..3f7e675a50fa 100644 --- a/cli/command/utils_test.go +++ b/cli/command/utils_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli/command" "gotest.tools/v3/assert" ) diff --git a/cli/command/volume/cmd.go b/cli/command/volume/cmd.go index 61477d168740..81693d57cfeb 100644 --- a/cli/command/volume/cmd.go +++ b/cli/command/volume/cmd.go @@ -1,9 +1,9 @@ package volume import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/internal/commands" "github.com/spf13/cobra" ) diff --git a/cli/command/volume/create.go b/cli/command/volume/create.go index 80b09ed2097b..b514e587ff2e 100644 --- a/cli/command/volume/create.go +++ b/cli/command/volume/create.go @@ -11,9 +11,9 @@ import ( "slices" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index 3f9e43cdc016..fa860cd7dda1 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" diff --git a/cli/command/volume/inspect.go b/cli/command/volume/inspect.go index 98c1d784750e..9095ee516ce9 100644 --- a/cli/command/volume/inspect.go +++ b/cli/command/volume/inspect.go @@ -6,11 +6,11 @@ package volume import ( "context" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" - "github.com/docker/cli/cli/command/inspect" - flagsHelper "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" + "github.com/docker/cli/v29/cli/command/inspect" + flagsHelper "github.com/docker/cli/v29/cli/flags" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/volume/inspect_test.go b/cli/command/volume/inspect_test.go index e56d0a4fab53..c9262ee4490e 100644 --- a/cli/command/volume/inspect_test.go +++ b/cli/command/volume/inspect_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" diff --git a/cli/command/volume/list.go b/cli/command/volume/list.go index bab03f9f44f5..b8bafaef4112 100644 --- a/cli/command/volume/list.go +++ b/cli/command/volume/list.go @@ -7,11 +7,11 @@ import ( "context" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" - flagsHelper "github.com/docker/cli/cli/flags" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" + flagsHelper "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/opts" "github.com/fvbommel/sortorder" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" diff --git a/cli/command/volume/list_test.go b/cli/command/volume/list_test.go index 5535aafead5b..a332075e89ae 100644 --- a/cli/command/volume/list_test.go +++ b/cli/command/volume/list_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/builders" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/builders" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/volume/prune.go b/cli/command/volume/prune.go index 53c218203aaf..f31b66cb7a9d 100644 --- a/cli/command/volume/prune.go +++ b/cli/command/volume/prune.go @@ -6,11 +6,11 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/system/pruner" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/system/pruner" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/opts" "github.com/docker/go-units" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index cbce72d22199..97ea8a504d3a 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/test" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" "gotest.tools/v3/assert" diff --git a/cli/command/volume/remove.go b/cli/command/volume/remove.go index 4cfc04e7bb4d..e413f5074218 100644 --- a/cli/command/volume/remove.go +++ b/cli/command/volume/remove.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/cli/command/volume/remove_test.go b/cli/command/volume/remove_test.go index 14fe2726c1c5..08e7ace86de0 100644 --- a/cli/command/volume/remove_test.go +++ b/cli/command/volume/remove_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/command/volume/update.go b/cli/command/volume/update.go index 0d986051b8a0..db0bd5a88025 100644 --- a/cli/command/volume/update.go +++ b/cli/command/volume/update.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/completion" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/completion" "github.com/moby/moby/api/types/volume" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cli/command/volume/update_test.go b/cli/command/volume/update_test.go index cffee60468ee..bb16a76b1077 100644 --- a/cli/command/volume/update_test.go +++ b/cli/command/volume/update_test.go @@ -4,7 +4,7 @@ import ( "io" "testing" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/cli/compose/convert/compose.go b/cli/compose/convert/compose.go index 4062bbb7c096..0064c97c01ab 100644 --- a/cli/compose/convert/compose.go +++ b/cli/compose/convert/compose.go @@ -5,7 +5,7 @@ import ( "os" "strings" - composetypes "github.com/docker/cli/cli/compose/types" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/client" diff --git a/cli/compose/convert/compose_test.go b/cli/compose/convert/compose_test.go index afd7420576ef..2f8d1071dc10 100644 --- a/cli/compose/convert/compose_test.go +++ b/cli/compose/convert/compose_test.go @@ -4,7 +4,7 @@ import ( "net/netip" "testing" - composetypes "github.com/docker/cli/cli/compose/types" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index d30597451a7d..29732fa1903a 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -14,9 +14,9 @@ import ( "strings" "time" - servicecli "github.com/docker/cli/cli/command/service" - composetypes "github.com/docker/cli/cli/compose/types" - "github.com/docker/cli/opts" + servicecli "github.com/docker/cli/v29/cli/command/service" + composetypes "github.com/docker/cli/v29/cli/compose/types" + "github.com/docker/cli/v29/opts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/swarm" diff --git a/cli/compose/convert/service_test.go b/cli/compose/convert/service_test.go index 7cd4db46e64b..5fe3a570a3cd 100644 --- a/cli/compose/convert/service_test.go +++ b/cli/compose/convert/service_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - composetypes "github.com/docker/cli/cli/compose/types" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/swarm" diff --git a/cli/compose/convert/volume.go b/cli/compose/convert/volume.go index 8eaa934cc097..15ecf4151ae7 100644 --- a/cli/compose/convert/volume.go +++ b/cli/compose/convert/volume.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - composetypes "github.com/docker/cli/cli/compose/types" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/moby/moby/api/types/mount" ) diff --git a/cli/compose/convert/volume_test.go b/cli/compose/convert/volume_test.go index 44865a0d7525..6e85b0fd336c 100644 --- a/cli/compose/convert/volume_test.go +++ b/cli/compose/convert/volume_test.go @@ -3,7 +3,7 @@ package convert import ( "testing" - composetypes "github.com/docker/cli/cli/compose/types" + composetypes "github.com/docker/cli/v29/cli/compose/types" "github.com/moby/moby/api/types/mount" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/compose/interpolation/interpolation.go b/cli/compose/interpolation/interpolation.go index 78dcde79cdc3..8f9496a8c71b 100644 --- a/cli/compose/interpolation/interpolation.go +++ b/cli/compose/interpolation/interpolation.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/docker/cli/cli/compose/template" + "github.com/docker/cli/v29/cli/compose/template" ) // Options supported by Interpolate diff --git a/cli/compose/loader/envfile.go b/cli/compose/loader/envfile.go index 6430f4b5f5f8..2222fd107201 100644 --- a/cli/compose/loader/envfile.go +++ b/cli/compose/loader/envfile.go @@ -3,7 +3,7 @@ package loader import ( "os" - "github.com/docker/cli/pkg/kvfile" + "github.com/docker/cli/v29/pkg/kvfile" ) // parseEnvFile reads a file with environment variables enumerated by lines diff --git a/cli/compose/loader/full-struct_test.go b/cli/compose/loader/full-struct_test.go index 9a6e7a76d308..ee3486385e8e 100644 --- a/cli/compose/loader/full-struct_test.go +++ b/cli/compose/loader/full-struct_test.go @@ -6,7 +6,7 @@ package loader import ( "time" - "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/compose/types" ) func fullExampleConfig(workingDir, homeDir string) *types.Config { diff --git a/cli/compose/loader/interpolate.go b/cli/compose/loader/interpolate.go index ef84ea10a4bd..2f5861d47915 100644 --- a/cli/compose/loader/interpolate.go +++ b/cli/compose/loader/interpolate.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - interp "github.com/docker/cli/cli/compose/interpolation" + interp "github.com/docker/cli/v29/cli/compose/interpolation" ) var interpolateTypeCastMapping = map[interp.Path]interp.Cast{ diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index 0a9cb03ae0a5..0f43d22ca9cb 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -15,13 +15,13 @@ import ( "strings" "time" - interp "github.com/docker/cli/cli/compose/interpolation" - "github.com/docker/cli/cli/compose/schema" - "github.com/docker/cli/cli/compose/template" - "github.com/docker/cli/cli/compose/types" - "github.com/docker/cli/internal/volumespec" - "github.com/docker/cli/opts" - "github.com/docker/cli/opts/swarmopts" + interp "github.com/docker/cli/v29/cli/compose/interpolation" + "github.com/docker/cli/v29/cli/compose/schema" + "github.com/docker/cli/v29/cli/compose/template" + "github.com/docker/cli/v29/cli/compose/types" + "github.com/docker/cli/v29/internal/volumespec" + "github.com/docker/cli/v29/opts" + "github.com/docker/cli/v29/opts/swarmopts" "github.com/docker/go-connections/nat" "github.com/docker/go-units" "github.com/go-viper/mapstructure/v2" diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 41f70c7cb23c..86dd77562474 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -9,7 +9,7 @@ import ( "runtime" "testing" - "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/compose/types" "github.com/google/go-cmp/cmp/cmpopts" "github.com/sirupsen/logrus" "gotest.tools/v3/assert" diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index cf666ab0b2cc..818574b0413c 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -11,7 +11,7 @@ import ( "slices" "dario.cat/mergo" - "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/compose/types" ) type specials struct { diff --git a/cli/compose/loader/merge_test.go b/cli/compose/loader/merge_test.go index cd09a2beb5f3..934ffe79a77b 100644 --- a/cli/compose/loader/merge_test.go +++ b/cli/compose/loader/merge_test.go @@ -8,7 +8,7 @@ import ( "testing" "dario.cat/mergo" - "github.com/docker/cli/cli/compose/types" + "github.com/docker/cli/v29/cli/compose/types" "gotest.tools/v3/assert" ) diff --git a/cli/compose/template/template.go b/cli/compose/template/template.go index 14ba09de3599..f5217bb60482 100644 --- a/cli/compose/template/template.go +++ b/cli/compose/template/template.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/docker/cli/internal/lazyregexp" + "github.com/docker/cli/v29/internal/lazyregexp" ) const ( diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index ad59ce052b00..f28f6e5748c4 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -10,7 +10,7 @@ import ( "strconv" "time" - "github.com/docker/cli/internal/volumespec" + "github.com/docker/cli/v29/internal/volumespec" ) // UnsupportedProperties not yet supported by this implementation of the compose file diff --git a/cli/config/config.go b/cli/config/config.go index a7ea0acdd7e6..798c7a7138f0 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -9,9 +9,9 @@ import ( "runtime" "sync" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/types" ) const ( diff --git a/cli/config/config_test.go b/cli/config/config_test.go index 922641a726ad..4d348c2425fb 100644 --- a/cli/config/config_test.go +++ b/cli/config/config_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/config/credentials" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/skip" diff --git a/cli/config/configfile/file.go b/cli/config/configfile/file.go index e32b1e767cbb..9babe40b2c30 100644 --- a/cli/config/configfile/file.go +++ b/cli/config/configfile/file.go @@ -14,9 +14,9 @@ import ( "path/filepath" "strings" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/memorystore" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/memorystore" + "github.com/docker/cli/v29/cli/config/types" "github.com/sirupsen/logrus" ) diff --git a/cli/config/configfile/file_test.go b/cli/config/configfile/file_test.go index 92df02c74352..1591e4c4904c 100644 --- a/cli/config/configfile/file_test.go +++ b/cli/config/configfile/file_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/fs" diff --git a/cli/config/credentials/credentials.go b/cli/config/credentials/credentials.go index 28d58ec48d7d..92b408579775 100644 --- a/cli/config/credentials/credentials.go +++ b/cli/config/credentials/credentials.go @@ -1,7 +1,7 @@ package credentials import ( - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" ) // Store is the interface that any credentials store must implement. diff --git a/cli/config/credentials/file_store.go b/cli/config/credentials/file_store.go index d4037b7a488c..de0e2b15295b 100644 --- a/cli/config/credentials/file_store.go +++ b/cli/config/credentials/file_store.go @@ -8,7 +8,7 @@ import ( "strings" "sync/atomic" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" ) type store interface { diff --git a/cli/config/credentials/file_store_test.go b/cli/config/credentials/file_store_test.go index d4c8375ea25e..d7c476ff8f06 100644 --- a/cli/config/credentials/file_store_test.go +++ b/cli/config/credentials/file_store_test.go @@ -3,7 +3,7 @@ package credentials import ( "testing" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/config/credentials/native_store.go b/cli/config/credentials/native_store.go index b9af145b9dcb..5f37326cebbf 100644 --- a/cli/config/credentials/native_store.go +++ b/cli/config/credentials/native_store.go @@ -1,7 +1,7 @@ package credentials import ( - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" "github.com/docker/docker-credential-helpers/client" "github.com/docker/docker-credential-helpers/credentials" ) diff --git a/cli/config/credentials/native_store_test.go b/cli/config/credentials/native_store_test.go index 02c85dbcfb7d..d55a11a7f950 100644 --- a/cli/config/credentials/native_store_test.go +++ b/cli/config/credentials/native_store_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" "github.com/docker/docker-credential-helpers/client" "github.com/docker/docker-credential-helpers/credentials" "gotest.tools/v3/assert" diff --git a/cli/config/memorystore/store.go b/cli/config/memorystore/store.go index da1e94f41696..badabdf4d818 100644 --- a/cli/config/memorystore/store.go +++ b/cli/config/memorystore/store.go @@ -9,8 +9,8 @@ import ( "os" "sync" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/types" ) // notFoundErr is the error returned when a plugin could not be found. diff --git a/cli/config/memorystore/store_test.go b/cli/config/memorystore/store_test.go index a92a170a3b6b..3ff36a106b8a 100644 --- a/cli/config/memorystore/store_test.go +++ b/cli/config/memorystore/store_test.go @@ -3,7 +3,7 @@ package memorystore import ( "testing" - "github.com/docker/cli/cli/config/types" + "github.com/docker/cli/v29/cli/config/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cli/connhelper/connhelper.go b/cli/connhelper/connhelper.go index 40281a56f8c2..aae7fb9a381d 100644 --- a/cli/connhelper/connhelper.go +++ b/cli/connhelper/connhelper.go @@ -12,8 +12,8 @@ import ( "slices" "strings" - "github.com/docker/cli/cli/connhelper/commandconn" - "github.com/docker/cli/cli/connhelper/ssh" + "github.com/docker/cli/v29/cli/connhelper/commandconn" + "github.com/docker/cli/v29/cli/connhelper/ssh" ) // ConnectionHelper allows to connect to a remote host with custom stream provider binary. diff --git a/cli/connhelper/ssh/ssh.go b/cli/connhelper/ssh/ssh.go index b91f2bc02e11..7ce8ba8d3def 100644 --- a/cli/connhelper/ssh/ssh.go +++ b/cli/connhelper/ssh/ssh.go @@ -9,7 +9,7 @@ import ( "fmt" "net/url" - "github.com/docker/cli/cli/connhelper/internal/syntax" + "github.com/docker/cli/v29/cli/connhelper/internal/syntax" ) // ParseURL creates a [Spec] from the given ssh URL. It returns an error if diff --git a/cli/context/docker/load.go b/cli/context/docker/load.go index a5c44f93430a..92aabf4018c3 100644 --- a/cli/context/docker/load.go +++ b/cli/context/docker/load.go @@ -11,9 +11,9 @@ import ( "strings" "time" - "github.com/docker/cli/cli/connhelper" - "github.com/docker/cli/cli/context" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/connhelper" + "github.com/docker/cli/v29/cli/context" + "github.com/docker/cli/v29/cli/context/store" "github.com/docker/go-connections/tlsconfig" "github.com/moby/moby/client" ) diff --git a/cli/context/tlsdata.go b/cli/context/tlsdata.go index 9a53d2fd0108..6c6a999f1699 100644 --- a/cli/context/tlsdata.go +++ b/cli/context/tlsdata.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" "github.com/sirupsen/logrus" ) diff --git a/cli/flags/options.go b/cli/flags/options.go index 8c31a0f17216..22024a9c2c45 100644 --- a/cli/flags/options.go +++ b/cli/flags/options.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "github.com/docker/go-connections/tlsconfig" "github.com/moby/moby/client" "github.com/sirupsen/logrus" diff --git a/cli/flags/options_test.go b/cli/flags/options_test.go index ed12e875a43d..cf365ee7d6dc 100644 --- a/cli/flags/options_test.go +++ b/cli/flags/options_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "github.com/spf13/pflag" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cli/manifest/store/store.go b/cli/manifest/store/store.go index f891f3ec2a51..0e562f5b0813 100644 --- a/cli/manifest/store/store.go +++ b/cli/manifest/store/store.go @@ -9,7 +9,7 @@ import ( "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/types" + "github.com/docker/cli/v29/cli/manifest/types" "github.com/docker/distribution/manifest/manifestlist" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/cli/manifest/store/store_test.go b/cli/manifest/store/store_test.go index d5c3ef67818e..265b7fbeb129 100644 --- a/cli/manifest/store/store_test.go +++ b/cli/manifest/store/store_test.go @@ -6,7 +6,7 @@ import ( "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/types" + "github.com/docker/cli/v29/cli/manifest/types" "github.com/google/go-cmp/cmp" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cmd/docker-trust/go.mod b/cmd/docker-trust/go.mod index 2fecc990ac4d..697817b35991 100644 --- a/cmd/docker-trust/go.mod +++ b/cmd/docker-trust/go.mod @@ -5,13 +5,14 @@ go 1.26.0 require ( github.com/containerd/errdefs v1.0.0 github.com/distribution/reference v0.6.0 - github.com/docker/cli v29.8.2+incompatible github.com/docker/cli-docs-tool v0.11.0 + github.com/docker/cli/v29 v29.8.2 github.com/docker/distribution v2.8.3+incompatible github.com/docker/go-connections v0.8.2 github.com/fvbommel/sortorder v1.2.0 github.com/moby/moby/api v1.56.1 github.com/moby/moby/client v0.6.2 + github.com/moby/term v0.5.2 github.com/opencontainers/go-digest v1.0.0 github.com/sirupsen/logrus v1.10.2 github.com/spf13/cobra v1.10.2 @@ -23,13 +24,13 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/go-winio v0.6.3-0.20260930231756-f19d9717deb0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/clipperhouse/uax29/v2 v2.2.0 // indirect + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect - github.com/containerd/log v0.1.0 // indirect + github.com/containerd/log v0.2.0 // indirect github.com/containerd/platforms v1.0.0-rc.5 // indirect github.com/docker/docker-credential-helpers v0.9.9 // indirect github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect @@ -43,12 +44,11 @@ require ( github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/mattn/go-runewidth v0.0.28 // indirect + github.com/mattn/go-runewidth v0.0.31 // indirect github.com/miekg/pkcs11 v1.1.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/sequential v0.7.0 // indirect - github.com/moby/term v0.5.2 // indirect github.com/morikuni/aec v1.1.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect @@ -76,3 +76,5 @@ require ( google.golang.org/grpc v1.83.2 // indirect google.golang.org/protobuf v1.36.12 // indirect ) + +replace github.com/docker/cli/v29 => ../.. diff --git a/cmd/docker-trust/go.sum b/cmd/docker-trust/go.sum index c1b0238daeae..cc54de311a5d 100644 --- a/cmd/docker-trust/go.sum +++ b/cmd/docker-trust/go.sum @@ -2,8 +2,8 @@ github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 h1:m2xcjRABtG288 github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4/go.mod h1:MTUE7ZuZO89FAtAwozGg6AWD83pcdefnEq5gF82MB8s= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= -github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/go-winio v0.6.3-0.20260930231756-f19d9717deb0 h1:71VU8kW/LCxJkx41+YYys1EgQO+AUnPa1TrxTSyYUCU= +github.com/Microsoft/go-winio v0.6.3-0.20260930231756-f19d9717deb0/go.mod h1:ma0QpxizD4fyyzJ1C7MIblymTD2Nxz5Mho/3CepwIZg= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d h1:hi6J4K6DKrR4/ljxn6SF6nURyu785wKMuQcjt7H3VCQ= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -21,16 +21,16 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1x github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY= -github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= -github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= -github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/log v0.2.0 h1:BewD/umNgVnoczglOpX8eRMyEy5t5iPlu5AIpnWDONc= +github.com/containerd/log v0.2.0/go.mod h1:/M7L7CXKcPTfNC74XzaK+5H5KbO5+4lJVpuVI6vRLoM= github.com/containerd/platforms v1.0.0-rc.5 h1:vXd569rDrz8LeMXzAnBsy6LADV5YtsD8oyaRarxdmSU= github.com/containerd/platforms v1.0.0-rc.5/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -42,8 +42,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v29.8.2+incompatible h1:2zgdFuoFst2T80oS42vhKGxkd0JRo305eIEKTsxR7pQ= -github.com/docker/cli v29.8.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli-docs-tool v0.11.0 h1:7d8QARFb7QEobizqxmEM7fOteZEHwH/zWgHQtHZEcfE= github.com/docker/cli-docs-tool v0.11.0/go.mod h1:ma8BKiisUo8D6W05XEYIh3oa1UbgrZhi1nowyKFJa8Q= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -108,8 +106,8 @@ github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVt github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.20.1 h1:T7kKElXUMXrUJ2E9QhQhxFtcK5rPyLdsGZvdbLMPdiQ= +github.com/klauspost/compress v1.20.1/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -122,8 +120,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.5.3 h1:C8fxWnhYyME3n0klPOhVM7PtYUB3eV1W3DeFmN3j53Y= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU= -github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= +github.com/mattn/go-runewidth v0.0.31 h1:1oCV4ReTlosDBc6rYRw5cL8S/4y8iv5oRl4SJ5IBgwo= +github.com/mattn/go-runewidth v0.0.31/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= diff --git a/cmd/docker-trust/internal/commands/commands.go b/cmd/docker-trust/internal/commands/commands.go index 2a1750625c09..c99b891e164c 100644 --- a/cmd/docker-trust/internal/commands/commands.go +++ b/cmd/docker-trust/internal/commands/commands.go @@ -3,7 +3,7 @@ package commands import ( "os" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cmd/docker-trust/internal/jsonstream/display.go b/cmd/docker-trust/internal/jsonstream/display.go index de9d1e2cbcc2..0dd52ddf196e 100644 --- a/cmd/docker-trust/internal/jsonstream/display.go +++ b/cmd/docker-trust/internal/jsonstream/display.go @@ -4,7 +4,7 @@ import ( "context" "io" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/moby/api/types/jsonstream" "github.com/moby/moby/client/pkg/jsonmessage" ) diff --git a/cmd/docker-trust/internal/prompt/prompt.go b/cmd/docker-trust/internal/prompt/prompt.go index 58b6bbc17587..9fd5c1e3e30f 100644 --- a/cmd/docker-trust/internal/prompt/prompt.go +++ b/cmd/docker-trust/internal/prompt/prompt.go @@ -10,7 +10,7 @@ import ( "runtime" "strings" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/term" ) diff --git a/cmd/docker-trust/internal/test/cli.go b/cmd/docker-trust/internal/test/cli.go index 20047cb0f39e..c8b459320d78 100644 --- a/cmd/docker-trust/internal/test/cli.go +++ b/cmd/docker-trust/internal/test/cli.go @@ -6,9 +6,9 @@ import ( "io" "strings" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/moby/client" notaryclient "github.com/theupdateframework/notary/client" ) diff --git a/cmd/docker-trust/internal/test/cmd.go b/cmd/docker-trust/internal/test/cmd.go index ec9a1b4abc26..51aeff1b4f9a 100644 --- a/cmd/docker-trust/internal/test/cmd.go +++ b/cmd/docker-trust/internal/test/cmd.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/docker/cli/cli/streams" "github.com/docker/cli/cmd/docker-trust/internal/prompt" + "github.com/docker/cli/v29/cli/streams" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/cmd/docker-trust/internal/trust/trust.go b/cmd/docker-trust/internal/trust/trust.go index a20cb273af64..6f74cb427b22 100644 --- a/cmd/docker-trust/internal/trust/trust.go +++ b/cmd/docker-trust/internal/trust/trust.go @@ -16,8 +16,8 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cmd/docker-trust/internal/registry" + "github.com/docker/cli/v29/cli/config" "github.com/docker/distribution/registry/client/auth" "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" diff --git a/cmd/docker-trust/internal/trust/trust_push.go b/cmd/docker-trust/internal/trust/trust_push.go index 7a3f893c90ff..d17b4b782c0b 100644 --- a/cmd/docker-trust/internal/trust/trust_push.go +++ b/cmd/docker-trust/internal/trust/trust_push.go @@ -10,8 +10,8 @@ import ( "slices" "github.com/distribution/reference" - "github.com/docker/cli/cli/streams" "github.com/docker/cli/cmd/docker-trust/internal/jsonstream" + "github.com/docker/cli/v29/cli/streams" registrytypes "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" "github.com/theupdateframework/notary/client" @@ -20,7 +20,7 @@ import ( // Streams is an interface which exposes the standard input and output streams. // -// Same interface as [github.com/docker/cli/cli/command.Streams] but defined here to prevent a circular import. +// Same interface as [github.com/docker/cli/v29/cli/command.Streams] but defined here to prevent a circular import. type Streams interface { In() *streams.In Out() *streams.Out diff --git a/cmd/docker-trust/main.go b/cmd/docker-trust/main.go index 288b40eeb1e7..568fcc0f07f4 100644 --- a/cmd/docker-trust/main.go +++ b/cmd/docker-trust/main.go @@ -9,12 +9,12 @@ import ( "syscall" cerrdefs "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli-plugins/plugin" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/version" "github.com/docker/cli/cmd/docker-trust/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/plugin" + "github.com/docker/cli/v29/cli/command" "go.opentelemetry.io/otel" ) diff --git a/cmd/docker-trust/trust/cmd.go b/cmd/docker-trust/trust/cmd.go index 40f7a1d9bbed..b1d9914a90c7 100644 --- a/cmd/docker-trust/trust/cmd.go +++ b/cmd/docker-trust/trust/cmd.go @@ -1,9 +1,9 @@ package trust import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cmd/docker-trust/trust/commands.go b/cmd/docker-trust/trust/commands.go index cb0fc6fc4967..b9b4bc85a892 100644 --- a/cmd/docker-trust/trust/commands.go +++ b/cmd/docker-trust/trust/commands.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/docker/cli-docs-tool/annotation" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli-plugins/plugin" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/debug" - cliflags "github.com/docker/cli/cli/flags" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli-plugins/plugin" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/debug" + cliflags "github.com/docker/cli/v29/cli/flags" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/cmd/docker-trust/trust/common.go b/cmd/docker-trust/trust/common.go index c743d49722ce..b888d82be018 100644 --- a/cmd/docker-trust/trust/common.go +++ b/cmd/docker-trust/trust/common.go @@ -7,10 +7,10 @@ import ( "slices" "strings" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" "github.com/fvbommel/sortorder" registrytypes "github.com/moby/moby/api/types/registry" "github.com/sirupsen/logrus" diff --git a/cmd/docker-trust/trust/formatter.go b/cmd/docker-trust/trust/formatter.go index 2bde36115f25..6a4a0d4b5e16 100644 --- a/cmd/docker-trust/trust/formatter.go +++ b/cmd/docker-trust/trust/formatter.go @@ -4,7 +4,7 @@ import ( "slices" "strings" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command/formatter" ) const ( diff --git a/cmd/docker-trust/trust/formatter_test.go b/cmd/docker-trust/trust/formatter_test.go index 49c8ba24cfa2..cefccbac9463 100644 --- a/cmd/docker-trust/trust/formatter_test.go +++ b/cmd/docker-trust/trust/formatter_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/docker/cli/cli/command/formatter" "github.com/docker/cli/cmd/docker-trust/internal/test" + "github.com/docker/cli/v29/cli/command/formatter" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cmd/docker-trust/trust/inspect.go b/cmd/docker-trust/trust/inspect.go index fe16121ce7ba..dcac604d2ca4 100644 --- a/cmd/docker-trust/trust/inspect.go +++ b/cmd/docker-trust/trust/inspect.go @@ -10,9 +10,9 @@ import ( "fmt" "slices" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/inspect" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/inspect" "github.com/spf13/cobra" "github.com/theupdateframework/notary/tuf/data" ) diff --git a/cmd/docker-trust/trust/inspect_pretty.go b/cmd/docker-trust/trust/inspect_pretty.go index 4336f0872a24..aebca3d5f4e7 100644 --- a/cmd/docker-trust/trust/inspect_pretty.go +++ b/cmd/docker-trust/trust/inspect_pretty.go @@ -7,8 +7,8 @@ import ( "io" "slices" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/formatter" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/formatter" "github.com/fvbommel/sortorder" "github.com/theupdateframework/notary/client" ) diff --git a/cmd/docker-trust/trust/key.go b/cmd/docker-trust/trust/key.go index bc1ede41680f..c4502252a7cd 100644 --- a/cmd/docker-trust/trust/key.go +++ b/cmd/docker-trust/trust/key.go @@ -1,8 +1,8 @@ package trust import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cmd/docker-trust/trust/key_generate.go b/cmd/docker-trust/trust/key_generate.go index 8640f53ea77b..3dbcf987349a 100644 --- a/cmd/docker-trust/trust/key_generate.go +++ b/cmd/docker-trust/trust/key_generate.go @@ -7,10 +7,10 @@ import ( "path/filepath" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/lazyregexp" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/trustmanager" diff --git a/cmd/docker-trust/trust/key_generate_test.go b/cmd/docker-trust/trust/key_generate_test.go index f971dc238892..50006bac8427 100644 --- a/cmd/docker-trust/trust/key_generate_test.go +++ b/cmd/docker-trust/trust/key_generate_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cmd/docker-trust/internal/test" + "github.com/docker/cli/v29/cli/config" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/trustmanager" tufutils "github.com/theupdateframework/notary/tuf/utils" diff --git a/cmd/docker-trust/trust/key_load.go b/cmd/docker-trust/trust/key_load.go index 7234dbc1a0e2..30e2f362861c 100644 --- a/cmd/docker-trust/trust/key_load.go +++ b/cmd/docker-trust/trust/key_load.go @@ -9,9 +9,9 @@ import ( "os" "runtime" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/storage" diff --git a/cmd/docker-trust/trust/key_load_test.go b/cmd/docker-trust/trust/key_load_test.go index 3b3ec08e1eea..44f9be273d14 100644 --- a/cmd/docker-trust/trust/key_load_test.go +++ b/cmd/docker-trust/trust/key_load_test.go @@ -9,8 +9,8 @@ import ( "runtime" "testing" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cmd/docker-trust/internal/test" + "github.com/docker/cli/v29/cli/config" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/storage" "github.com/theupdateframework/notary/trustmanager" diff --git a/cmd/docker-trust/trust/revoke.go b/cmd/docker-trust/trust/revoke.go index 9bff3abf2c8d..6b79ed289a86 100644 --- a/cmd/docker-trust/trust/revoke.go +++ b/cmd/docker-trust/trust/revoke.go @@ -5,10 +5,10 @@ import ( "errors" "fmt" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/prompt" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" diff --git a/cmd/docker-trust/trust/sign.go b/cmd/docker-trust/trust/sign.go index f965ffb86a37..83799c67a7ca 100644 --- a/cmd/docker-trust/trust/sign.go +++ b/cmd/docker-trust/trust/sign.go @@ -10,9 +10,9 @@ import ( "strings" "github.com/distribution/reference" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/pkg/authconfig" "github.com/moby/moby/client" "github.com/spf13/cobra" diff --git a/cmd/docker-trust/trust/sign_test.go b/cmd/docker-trust/trust/sign_test.go index e7604c958419..c3833f1992b2 100644 --- a/cmd/docker-trust/trust/sign_test.go +++ b/cmd/docker-trust/trust/sign_test.go @@ -7,10 +7,10 @@ import ( "runtime" "testing" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cmd/docker-trust/internal/test" notaryfake "github.com/docker/cli/cmd/docker-trust/internal/test/notary" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli/config" "github.com/theupdateframework/notary" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/client/changelist" diff --git a/cmd/docker-trust/trust/signer.go b/cmd/docker-trust/trust/signer.go index c765abeb1344..550051ce67fa 100644 --- a/cmd/docker-trust/trust/signer.go +++ b/cmd/docker-trust/trust/signer.go @@ -1,8 +1,8 @@ package trust import ( - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cmd/docker-trust/trust/signer_add.go b/cmd/docker-trust/trust/signer_add.go index 1ba91c243fde..63d33d7117ea 100644 --- a/cmd/docker-trust/trust/signer_add.go +++ b/cmd/docker-trust/trust/signer_add.go @@ -9,11 +9,11 @@ import ( "path" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/lazyregexp" "github.com/docker/cli/cmd/docker-trust/internal/trust" - "github.com/docker/cli/opts" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/opts" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" diff --git a/cmd/docker-trust/trust/signer_add_test.go b/cmd/docker-trust/trust/signer_add_test.go index 02858e2ddd90..44ab0a526db2 100644 --- a/cmd/docker-trust/trust/signer_add_test.go +++ b/cmd/docker-trust/trust/signer_add_test.go @@ -8,9 +8,9 @@ import ( "runtime" "testing" - "github.com/docker/cli/cli/config" "github.com/docker/cli/cmd/docker-trust/internal/test" notaryfake "github.com/docker/cli/cmd/docker-trust/internal/test/notary" + "github.com/docker/cli/v29/cli/config" "github.com/theupdateframework/notary" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cmd/docker-trust/trust/signer_remove.go b/cmd/docker-trust/trust/signer_remove.go index 206066262088..535fb1cad59a 100644 --- a/cmd/docker-trust/trust/signer_remove.go +++ b/cmd/docker-trust/trust/signer_remove.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" "github.com/docker/cli/cmd/docker-trust/internal/prompt" "github.com/docker/cli/cmd/docker-trust/internal/trust" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" diff --git a/cmd/docker/aliases.go b/cmd/docker/aliases.go index ea17579c1e74..f499c1d3209b 100644 --- a/cmd/docker/aliases.go +++ b/cmd/docker/aliases.go @@ -5,8 +5,8 @@ import ( "os" "strings" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli/command" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/cmd/docker/builder.go b/cmd/docker/builder.go index d6d74919bc28..c65f5dd4df14 100644 --- a/cmd/docker/builder.go +++ b/cmd/docker/builder.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/containerd/errdefs" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/command" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/api/types/build" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/cmd/docker/builder_test.go b/cmd/docker/builder_test.go index 9f7d67bf4742..8eae0b048d3d 100644 --- a/cmd/docker/builder_test.go +++ b/cmd/docker/builder_test.go @@ -10,10 +10,10 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/context/store" - "github.com/docker/cli/cli/flags" - "github.com/docker/cli/internal/test/output" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/context/store" + "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/internal/test/output" "github.com/moby/moby/client" "gotest.tools/v3/assert" "gotest.tools/v3/fs" diff --git a/cmd/docker/cloud.go b/cmd/docker/cloud.go index baf962c38745..0dc3a576fc3a 100644 --- a/cmd/docker/cloud.go +++ b/cmd/docker/cloud.go @@ -12,12 +12,12 @@ import ( "strings" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config" - contextdocker "github.com/docker/cli/cli/context/docker" + "github.com/docker/cli/v29/cli" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config" + contextdocker "github.com/docker/cli/v29/cli/context/docker" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/cmd/docker/cloud_test.go b/cmd/docker/cloud_test.go index 485f3bc2b0de..ed7b99cf506e 100644 --- a/cmd/docker/cloud_test.go +++ b/cmd/docker/cloud_test.go @@ -18,12 +18,12 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" - contextdocker "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" + contextdocker "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/cmd/docker/completions.go b/cmd/docker/completions.go index 7c1196d2cf64..276e1f1b5ca9 100644 --- a/cmd/docker/completions.go +++ b/cmd/docker/completions.go @@ -1,7 +1,7 @@ package main import ( - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" ) diff --git a/cmd/docker/completions_test.go b/cmd/docker/completions_test.go index 3fa5b35532c0..ebbf58c46f72 100644 --- a/cmd/docker/completions_test.go +++ b/cmd/docker/completions_test.go @@ -3,7 +3,7 @@ package main import ( "testing" - "github.com/docker/cli/cli/context/store" + "github.com/docker/cli/v29/cli/context/store" "github.com/spf13/cobra" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index 47c720e941f5..a634d48de875 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -16,15 +16,15 @@ import ( "syscall" "github.com/containerd/errdefs" - "github.com/docker/cli/cli" - pluginmanager "github.com/docker/cli/cli-plugins/manager" - "github.com/docker/cli/cli-plugins/socket" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/commands" - "github.com/docker/cli/cli/debug" - cliflags "github.com/docker/cli/cli/flags" - "github.com/docker/cli/cli/version" - platformsignals "github.com/docker/cli/cmd/docker/internal/signals" + "github.com/docker/cli/v29/cli" + pluginmanager "github.com/docker/cli/v29/cli-plugins/manager" + "github.com/docker/cli/v29/cli-plugins/socket" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/commands" + "github.com/docker/cli/v29/cli/debug" + cliflags "github.com/docker/cli/v29/cli/flags" + "github.com/docker/cli/v29/cli/version" + platformsignals "github.com/docker/cli/v29/cmd/docker/internal/signals" "github.com/moby/moby/client/pkg/versions" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/docker/docker_test.go b/cmd/docker/docker_test.go index e68ba48db92b..22dddf4c7565 100644 --- a/cmd/docker/docker_test.go +++ b/cmd/docker/docker_test.go @@ -11,11 +11,11 @@ import ( "testing" "time" - dockercli "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/commands" - "github.com/docker/cli/cli/debug" - platformsignals "github.com/docker/cli/cmd/docker/internal/signals" + dockercli "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/commands" + "github.com/docker/cli/v29/cli/debug" + platformsignals "github.com/docker/cli/v29/cmd/docker/internal/signals" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "gotest.tools/v3/assert" diff --git a/cmd/docker/docker_windows_386.go b/cmd/docker/docker_windows_386.go index 0370eee4183f..09f1479502a0 100644 --- a/cmd/docker/docker_windows_386.go +++ b/cmd/docker/docker_windows_386.go @@ -4,4 +4,4 @@ package main -import _ "github.com/docker/cli/cmd/docker/winresources" +import _ "github.com/docker/cli/v29/cmd/docker/winresources" diff --git a/cmd/docker/docker_windows_amd64.go b/cmd/docker/docker_windows_amd64.go index 455f4f57594d..612481c27c08 100644 --- a/cmd/docker/docker_windows_amd64.go +++ b/cmd/docker/docker_windows_amd64.go @@ -4,4 +4,4 @@ package main -import _ "github.com/docker/cli/cmd/docker/winresources" +import _ "github.com/docker/cli/v29/cmd/docker/winresources" diff --git a/cmd/docker/docker_windows_arm.go b/cmd/docker/docker_windows_arm.go index ac452c64bba5..43e3d4169c22 100644 --- a/cmd/docker/docker_windows_arm.go +++ b/cmd/docker/docker_windows_arm.go @@ -4,4 +4,4 @@ package main -import _ "github.com/docker/cli/cmd/docker/winresources" +import _ "github.com/docker/cli/v29/cmd/docker/winresources" diff --git a/cmd/docker/docker_windows_arm64.go b/cmd/docker/docker_windows_arm64.go index 318011c9dc5f..09563bd621be 100644 --- a/cmd/docker/docker_windows_arm64.go +++ b/cmd/docker/docker_windows_arm64.go @@ -4,4 +4,4 @@ package main -import _ "github.com/docker/cli/cmd/docker/winresources" +import _ "github.com/docker/cli/v29/cmd/docker/winresources" diff --git a/docs/generate/generate.go b/docs/generate/generate.go index 4d796c654e2b..fe95f57cde13 100644 --- a/docs/generate/generate.go +++ b/docs/generate/generate.go @@ -10,9 +10,9 @@ import ( "os" clidocstool "github.com/docker/cli-docs-tool" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/commands" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/e2e/cli-plugins/config_test.go b/e2e/cli-plugins/config_test.go index 1cac1dd7b1e8..971dd7f4371d 100644 --- a/e2e/cli-plugins/config_test.go +++ b/e2e/cli-plugins/config_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" ) diff --git a/e2e/cli-plugins/dial_test.go b/e2e/cli-plugins/dial_test.go index c66fb9ce9d19..ba437f551904 100644 --- a/e2e/cli-plugins/dial_test.go +++ b/e2e/cli-plugins/dial_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" "gotest.tools/v3/icmd" ) diff --git a/e2e/cli-plugins/main_test.go b/e2e/cli-plugins/main_test.go index 911a5c065e8c..39b03a3c3c19 100644 --- a/e2e/cli-plugins/main_test.go +++ b/e2e/cli-plugins/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/cli-plugins/plugins/badmeta/main.go b/e2e/cli-plugins/plugins/badmeta/main.go index 8b93c7ab8b35..abaded49ebc2 100644 --- a/e2e/cli-plugins/plugins/badmeta/main.go +++ b/e2e/cli-plugins/plugins/badmeta/main.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/docker/cli/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/metadata" ) func main() { diff --git a/e2e/cli-plugins/plugins/nopersistentprerun/main.go b/e2e/cli-plugins/plugins/nopersistentprerun/main.go index c6319ffa8a4b..1ad25a23de4a 100644 --- a/e2e/cli-plugins/plugins/nopersistentprerun/main.go +++ b/e2e/cli-plugins/plugins/nopersistentprerun/main.go @@ -3,9 +3,9 @@ package main import ( "fmt" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli-plugins/plugin" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/plugin" + "github.com/docker/cli/v29/cli/command" "github.com/moby/moby/client" "github.com/spf13/cobra" ) diff --git a/e2e/cli-plugins/plugins/presocket/main.go b/e2e/cli-plugins/plugins/presocket/main.go index d1a4b3501175..bdb25bd5720f 100644 --- a/e2e/cli-plugins/plugins/presocket/main.go +++ b/e2e/cli-plugins/plugins/presocket/main.go @@ -7,9 +7,9 @@ import ( "syscall" "time" - "github.com/docker/cli/cli-plugins/metadata" - "github.com/docker/cli/cli-plugins/plugin" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli-plugins/metadata" + "github.com/docker/cli/v29/cli-plugins/plugin" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/e2e/cli-plugins/util_test.go b/e2e/cli-plugins/util_test.go index 2f8e0f34e7e9..bc7134310e61 100644 --- a/e2e/cli-plugins/util_test.go +++ b/e2e/cli-plugins/util_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "github.com/docker/cli/cli/config" - "github.com/docker/cli/cli/config/configfile" + "github.com/docker/cli/v29/cli/config" + "github.com/docker/cli/v29/cli/config/configfile" "gotest.tools/v3/assert" "gotest.tools/v3/fs" "gotest.tools/v3/icmd" diff --git a/e2e/container/attach_test.go b/e2e/container/attach_test.go index 49765da891a8..708372e80240 100644 --- a/e2e/container/attach_test.go +++ b/e2e/container/attach_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" "gotest.tools/v3/skip" diff --git a/e2e/container/create_test.go b/e2e/container/create_test.go index 7a4bf67ae771..d107eae32e9c 100644 --- a/e2e/container/create_test.go +++ b/e2e/container/create_test.go @@ -3,7 +3,7 @@ package container import ( "testing" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/icmd" ) diff --git a/e2e/container/kill_test.go b/e2e/container/kill_test.go index d4deecc18f2d..d47044c3e5a2 100644 --- a/e2e/container/kill_test.go +++ b/e2e/container/kill_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/icmd" "gotest.tools/v3/poll" ) diff --git a/e2e/container/main_test.go b/e2e/container/main_test.go index 4363c438884b..91133a9557fc 100644 --- a/e2e/container/main_test.go +++ b/e2e/container/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/container/proxy_signal_test.go b/e2e/container/proxy_signal_test.go index acdd9a9e3849..7c1502169c6d 100644 --- a/e2e/container/proxy_signal_test.go +++ b/e2e/container/proxy_signal_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" "gotest.tools/v3/poll" diff --git a/e2e/container/rename_test.go b/e2e/container/rename_test.go index c1879bd1150a..84142681d3bf 100644 --- a/e2e/container/rename_test.go +++ b/e2e/container/rename_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" ) diff --git a/e2e/container/run_test.go b/e2e/container/run_test.go index fb6c8d19c7da..cba4ebef5e4d 100644 --- a/e2e/container/run_test.go +++ b/e2e/container/run_test.go @@ -12,8 +12,8 @@ import ( "time" "github.com/creack/pty" - "github.com/docker/cli/e2e/internal/fixtures" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/e2e/internal/fixtures" + "github.com/docker/cli/v29/internal/test/environment" "github.com/moby/moby/client/pkg/versions" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/e2e/context/context_test.go b/e2e/context/context_test.go index 9fba58326e9e..9544ec81193b 100644 --- a/e2e/context/context_test.go +++ b/e2e/context/context_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "gotest.tools/v3/assert" "gotest.tools/v3/golden" "gotest.tools/v3/icmd" diff --git a/e2e/context/main_test.go b/e2e/context/main_test.go index a3b1c530163d..4bb08cf1e4e2 100644 --- a/e2e/context/main_test.go +++ b/e2e/context/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/global/cli_test.go b/e2e/global/cli_test.go index aea0ce841557..6047a66fcee8 100644 --- a/e2e/global/cli_test.go +++ b/e2e/global/cli_test.go @@ -12,10 +12,10 @@ import ( "testing" "time" - "github.com/docker/cli/e2e/internal/fixtures" - "github.com/docker/cli/e2e/testutils" - "github.com/docker/cli/internal/test" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/testutils" + "github.com/docker/cli/v29/internal/test" + "github.com/docker/cli/v29/internal/test/environment" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" "gotest.tools/v3/poll" diff --git a/e2e/global/main_test.go b/e2e/global/main_test.go index 626ae1b8dc33..298341063ab9 100644 --- a/e2e/global/main_test.go +++ b/e2e/global/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/image/build_test.go b/e2e/image/build_test.go index a0af53eda09a..d7a95a914f83 100644 --- a/e2e/image/build_test.go +++ b/e2e/image/build_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - "github.com/docker/cli/e2e/internal/fixtures" - "github.com/docker/cli/internal/test/environment" - "github.com/docker/cli/internal/test/output" + "github.com/docker/cli/v29/e2e/internal/fixtures" + "github.com/docker/cli/v29/internal/test/environment" + "github.com/docker/cli/v29/internal/test/output" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/fs" diff --git a/e2e/image/main_test.go b/e2e/image/main_test.go index 4638467a013c..77389d9f587d 100644 --- a/e2e/image/main_test.go +++ b/e2e/image/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/image/private_test.go b/e2e/image/private_test.go index 351a1983cf6f..fa6696c77217 100644 --- a/e2e/image/private_test.go +++ b/e2e/image/private_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/assert" "gotest.tools/v3/icmd" ) diff --git a/e2e/image/pull_test.go b/e2e/image/pull_test.go index 383257bd609c..ee6060602d40 100644 --- a/e2e/image/pull_test.go +++ b/e2e/image/pull_test.go @@ -3,7 +3,7 @@ package image import ( "testing" - "github.com/docker/cli/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/internal/fixtures" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/icmd" diff --git a/e2e/internal/fixtures/fixtures.go b/e2e/internal/fixtures/fixtures.go index 26bec1d49ce9..cc5f364c6773 100644 --- a/e2e/internal/fixtures/fixtures.go +++ b/e2e/internal/fixtures/fixtures.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/docker/cli/cli/config" + "github.com/docker/cli/v29/cli/config" "gotest.tools/v3/fs" "gotest.tools/v3/icmd" ) diff --git a/e2e/plugin/main_test.go b/e2e/plugin/main_test.go index 8cb31a23e54c..647a177abc38 100644 --- a/e2e/plugin/main_test.go +++ b/e2e/plugin/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/plugin/plugin_test.go b/e2e/plugin/plugin_test.go index e1febb42ab34..b8568ffc92e4 100644 --- a/e2e/plugin/plugin_test.go +++ b/e2e/plugin/plugin_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/docker/cli/e2e/internal/fixtures" - "github.com/docker/cli/e2e/testutils" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/e2e/internal/fixtures" + "github.com/docker/cli/v29/e2e/testutils" + "github.com/docker/cli/v29/internal/test/environment" "gotest.tools/v3/icmd" "gotest.tools/v3/skip" ) diff --git a/e2e/registry/main_test.go b/e2e/registry/main_test.go index 9174715188f9..5a25fd1cda7d 100644 --- a/e2e/registry/main_test.go +++ b/e2e/registry/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/stack/main_test.go b/e2e/stack/main_test.go index 0d36e45bd466..9193dc4a6c9d 100644 --- a/e2e/stack/main_test.go +++ b/e2e/stack/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/e2e/stack/remove_test.go b/e2e/stack/remove_test.go index ddf8c81b7a68..ab7f01ed9354 100644 --- a/e2e/stack/remove_test.go +++ b/e2e/stack/remove_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" "gotest.tools/v3/golden" "gotest.tools/v3/icmd" "gotest.tools/v3/poll" diff --git a/e2e/system/main_test.go b/e2e/system/main_test.go index b154d1a19114..bdaf164ba58d 100644 --- a/e2e/system/main_test.go +++ b/e2e/system/main_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/docker/cli/internal/test/environment" + "github.com/docker/cli/v29/internal/test/environment" ) func TestMain(m *testing.M) { diff --git a/go.mod b/go.mod index 647f2babf51f..64468476ccba 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/docker/cli +module github.com/docker/cli/v29 go 1.26.0 diff --git a/internal/commands/commands.go b/internal/commands/commands.go index 2a1750625c09..c99b891e164c 100644 --- a/internal/commands/commands.go +++ b/internal/commands/commands.go @@ -3,7 +3,7 @@ package commands import ( "os" - "github.com/docker/cli/cli/command" + "github.com/docker/cli/v29/cli/command" "github.com/spf13/cobra" ) diff --git a/internal/jsonstream/display.go b/internal/jsonstream/display.go index de9d1e2cbcc2..0dd52ddf196e 100644 --- a/internal/jsonstream/display.go +++ b/internal/jsonstream/display.go @@ -4,7 +4,7 @@ import ( "context" "io" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/moby/api/types/jsonstream" "github.com/moby/moby/client/pkg/jsonmessage" ) diff --git a/internal/jsonstream/display_test.go b/internal/jsonstream/display_test.go index 813082e4f0b2..22fe99431e34 100644 --- a/internal/jsonstream/display_test.go +++ b/internal/jsonstream/display_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "gotest.tools/v3/assert" ) diff --git a/internal/oauth/api/api.go b/internal/oauth/api/api.go index 9526f84c9910..46e7d587f197 100644 --- a/internal/oauth/api/api.go +++ b/internal/oauth/api/api.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/docker/cli/cli/version" + "github.com/docker/cli/v29/cli/version" ) type OAuthAPI interface { diff --git a/internal/oauth/manager/manager.go b/internal/oauth/manager/manager.go index 96deb61b1325..9c564ec8ddf7 100644 --- a/internal/oauth/manager/manager.go +++ b/internal/oauth/manager/manager.go @@ -9,13 +9,13 @@ import ( "os" "strings" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/oauth" - "github.com/docker/cli/internal/oauth/api" - "github.com/docker/cli/internal/registry" - "github.com/docker/cli/internal/tui" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/oauth" + "github.com/docker/cli/v29/internal/oauth/api" + "github.com/docker/cli/v29/internal/registry" + "github.com/docker/cli/v29/internal/tui" "github.com/morikuni/aec" "github.com/sirupsen/logrus" diff --git a/internal/oauth/manager/manager_test.go b/internal/oauth/manager/manager_test.go index 44a744999b8b..d21b242f9498 100644 --- a/internal/oauth/manager/manager_test.go +++ b/internal/oauth/manager/manager_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/config/types" - "github.com/docker/cli/internal/oauth/api" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/config/types" + "github.com/docker/cli/v29/internal/oauth/api" "gotest.tools/v3/assert" ) diff --git a/internal/oauth/manager/util.go b/internal/oauth/manager/util.go index c5e268d21433..d26ddc1eedd4 100644 --- a/internal/oauth/manager/util.go +++ b/internal/oauth/manager/util.go @@ -5,8 +5,8 @@ import ( "runtime" "strings" - "github.com/docker/cli/cli/config/credentials" - "github.com/docker/cli/cli/version" + "github.com/docker/cli/v29/cli/config/credentials" + "github.com/docker/cli/v29/cli/version" ) const ( diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go index 58b6bbc17587..9fd5c1e3e30f 100644 --- a/internal/prompt/prompt.go +++ b/internal/prompt/prompt.go @@ -10,7 +10,7 @@ import ( "runtime" "strings" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/moby/term" ) diff --git a/internal/prompt/prompt_test.go b/internal/prompt/prompt_test.go index 2c9abfa7c7f8..86ee999f128b 100644 --- a/internal/prompt/prompt_test.go +++ b/internal/prompt/prompt_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/prompt" - "github.com/docker/cli/internal/test" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/prompt" + "github.com/docker/cli/v29/internal/test" "gotest.tools/v3/assert" ) diff --git a/internal/registryclient/client.go b/internal/registryclient/client.go index 20f0eda11d7f..cbb05d208e5d 100644 --- a/internal/registryclient/client.go +++ b/internal/registryclient/client.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/distribution/reference" - manifesttypes "github.com/docker/cli/cli/manifest/types" + manifesttypes "github.com/docker/cli/v29/cli/manifest/types" "github.com/docker/distribution" distributionclient "github.com/docker/distribution/registry/client" registrytypes "github.com/moby/moby/api/types/registry" diff --git a/internal/registryclient/endpoint.go b/internal/registryclient/endpoint.go index 6cef45350db3..22b5cf68ab05 100644 --- a/internal/registryclient/endpoint.go +++ b/internal/registryclient/endpoint.go @@ -9,7 +9,7 @@ import ( "time" "github.com/distribution/reference" - "github.com/docker/cli/internal/registry" + "github.com/docker/cli/v29/internal/registry" "github.com/docker/distribution/registry/client/auth" "github.com/docker/distribution/registry/client/transport" registrytypes "github.com/moby/moby/api/types/registry" diff --git a/internal/registryclient/fetcher.go b/internal/registryclient/fetcher.go index 5bc308b4cb0f..09169fe44b52 100644 --- a/internal/registryclient/fetcher.go +++ b/internal/registryclient/fetcher.go @@ -10,8 +10,8 @@ import ( "fmt" "github.com/distribution/reference" - "github.com/docker/cli/cli/manifest/types" - "github.com/docker/cli/internal/registry" + "github.com/docker/cli/v29/cli/manifest/types" + "github.com/docker/cli/v29/internal/registry" "github.com/docker/distribution" "github.com/docker/distribution/manifest/manifestlist" "github.com/docker/distribution/manifest/ocischema" diff --git a/internal/test/cli.go b/internal/test/cli.go index 4a5b0bf9a0fc..b4f3676d3bc2 100644 --- a/internal/test/cli.go +++ b/internal/test/cli.go @@ -5,13 +5,13 @@ import ( "io" "strings" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/context/docker" - "github.com/docker/cli/cli/context/store" - manifeststore "github.com/docker/cli/cli/manifest/store" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/registryclient" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/config/configfile" + "github.com/docker/cli/v29/cli/context/docker" + "github.com/docker/cli/v29/cli/context/store" + manifeststore "github.com/docker/cli/v29/cli/manifest/store" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/registryclient" "github.com/moby/moby/client" ) diff --git a/internal/test/cmd.go b/internal/test/cmd.go index 8b98d2df623b..8eba3bdbbd7a 100644 --- a/internal/test/cmd.go +++ b/internal/test/cmd.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/prompt" + "github.com/docker/cli/v29/cli/streams" + "github.com/docker/cli/v29/internal/prompt" "github.com/spf13/cobra" "gotest.tools/v3/assert" ) diff --git a/internal/tui/output.go b/internal/tui/output.go index 9022e66ae8cb..4674ffae5bb5 100644 --- a/internal/tui/output.go +++ b/internal/tui/output.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/docker/cli/cli/streams" + "github.com/docker/cli/v29/cli/streams" "github.com/morikuni/aec" ) diff --git a/man/generate.go b/man/generate.go index d072b8b67ec4..8a4fde4a711a 100644 --- a/man/generate.go +++ b/man/generate.go @@ -11,9 +11,9 @@ import ( "path/filepath" clidocstool "github.com/docker/cli-docs-tool" - "github.com/docker/cli/cli" - "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/command/commands" + "github.com/docker/cli/v29/cli" + "github.com/docker/cli/v29/cli/command" + "github.com/docker/cli/v29/cli/command/commands" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" "github.com/spf13/pflag" diff --git a/opts/opts.go b/opts/opts.go index 0a7706ca71ff..a57a27ee6d79 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" - "github.com/docker/cli/internal/lazyregexp" + "github.com/docker/cli/v29/internal/lazyregexp" "github.com/docker/go-units" "github.com/moby/moby/client" ) diff --git a/opts/parse.go b/opts/parse.go index cb817760e743..970ee5329dc8 100644 --- a/opts/parse.go +++ b/opts/parse.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/docker/cli/pkg/kvfile" + "github.com/docker/cli/v29/pkg/kvfile" "github.com/moby/moby/api/types/container" ) diff --git a/scripts/build/.variables b/scripts/build/.variables index cb1324f49ef8..1a8b9378103b 100755 --- a/scripts/build/.variables +++ b/scripts/build/.variables @@ -89,11 +89,11 @@ fi export GO_BUILDMODE GO_LDFLAGS="${GO_LDFLAGS:-}" -GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/cli/version.GitCommit=${GITCOMMIT}\"" -GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/cli/version.BuildTime=${BUILDTIME}\"" -GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/cli/version.Version=${VERSION}\"" +GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/v29/cli/version.GitCommit=${GITCOMMIT}\"" +GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/v29/cli/version.BuildTime=${BUILDTIME}\"" +GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/v29/cli/version.Version=${VERSION}\"" if test -n "${PLATFORM}"; then - GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/cli/version.PlatformName=${PLATFORM}\"" + GO_LDFLAGS="$GO_LDFLAGS -X \"github.com/docker/cli/v29/cli/version.PlatformName=${PLATFORM}\"" fi if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ] && [ "$(go env GOOS)" = "linux" ]; then GO_LDFLAGS="$GO_LDFLAGS -linkmode external -extldflags -static" @@ -124,7 +124,7 @@ fi if [ -n "$GO_STRIP" ]; then # if stripping enabled and building with llvm < 12 against darwin/amd64 # platform, it will fail with: - # # github.com/docker/cli/cmd/docker + # # github.com/docker/cli/v29/cmd/docker # /usr/local/go/pkg/tool/linux_amd64/link: /usr/local/go/pkg/tool/linux_amd64/link: running strip failed: exit status 1 # llvm-strip: error: unsupported load command (cmd=0x5) # more info: https://github.com/docker/cli/pull/3717 @@ -132,4 +132,4 @@ if [ -n "$GO_STRIP" ]; then fi export GO_LDFLAGS="$GO_LDFLAGS" # https://github.com/koalaman/shellcheck/issues/2064 -export SOURCE="github.com/docker/cli/cmd/docker" +export SOURCE="github.com/docker/cli/v29/cmd/docker" diff --git a/scripts/build/plugins b/scripts/build/plugins index 844f234adb2c..e37238e61f7d 100755 --- a/scripts/build/plugins +++ b/scripts/build/plugins @@ -21,5 +21,5 @@ for p in cli-plugins/examples/* "$@" ; do mkdir -p "$(dirname "${TARGET_PLUGIN}")" echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")" - (set -x ; go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}") + (set -x ; go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/v29/${p}") done From 4d906e42e28c7fb3d441ee96816875d10220d4f0 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 12 Sep 2026 01:24:30 +0900 Subject: [PATCH 4/5] GOPATH handling not necessary anymore The repository is a Go module now, so the test workflow no longer has to check out into a GOPATH-shaped directory. The remaining GOPATH use in scripts/test/e2e/run is unrelated: the e2e suite installs a test plugin into $GOPATH/bin. Signed-off-by: CrazyMax Assisted-by: Claude Opus 5 Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d39b34d354d..3b42a410161b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,10 +45,6 @@ jobs: host: runs-on: ${{ matrix.os }} - env: - GOPATH: ${{ github.workspace }} - GOBIN: ${{ github.workspace }}/bin - GO111MODULE: auto strategy: fail-fast: false matrix: @@ -62,7 +58,6 @@ jobs: name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - path: ${{ env.GOPATH }}/src/github.com/docker/cli persist-credentials: false - name: Set up Go @@ -75,12 +70,10 @@ jobs: run: | go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/v29/e2e/') go tool cover -func=/tmp/coverage.txt - working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli shell: bash - name: Send to Codecov uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: /tmp/coverage.txt - working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli token: ${{ secrets.CODECOV_TOKEN }} From c8d28bb6d29c118a6f69c54b4f6e04943454503e Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Sat, 12 Sep 2026 01:26:48 +0900 Subject: [PATCH 5/5] remove "//go:build go1.26" workarounds These were added because the repository was not a module: consumers got an implicitly generated go.mod, which made go assume the "go1.16" language version and reject any newer language feature. The "//go:build" directive overrode the language version on a per-file basis. Now that there is a real go.mod, its "go" directive sets the language version for every file in the module, so the workaround can go, as the FIXME they carried asked for. Assisted-by: Claude Opus 5 Signed-off-by: Akihiro Suda --- cli-plugins/hooks/hook_types.go | 3 --- cli-plugins/hooks/template.go | 3 --- cli-plugins/manager/error.go | 3 --- cli-plugins/manager/hooks.go | 3 --- cli-plugins/manager/manager.go | 3 --- cli-plugins/manager/plugin.go | 3 --- cli-plugins/metadata/metadata.go | 3 --- cli-plugins/plugin/plugin.go | 3 --- cli/cobra.go | 3 --- cli/command/cli.go | 3 --- cli/command/config/formatter.go | 3 --- cli/command/config/inspect.go | 3 --- cli/command/config/ls.go | 3 --- cli/command/container/completion.go | 3 --- cli/command/container/inspect.go | 3 --- cli/command/container/opts.go | 3 --- cli/command/container/port.go | 3 --- cli/command/container/start.go | 3 --- cli/command/container/stats.go | 3 --- cli/command/container/tty.go | 3 --- cli/command/context.go | 3 --- cli/command/context/completion.go | 3 --- cli/command/context/create.go | 3 --- cli/command/context/create_test.go | 3 --- cli/command/context/inspect.go | 3 --- cli/command/context/list.go | 3 --- cli/command/context/options.go | 3 --- cli/command/context_test.go | 3 --- cli/command/defaultcontextstore.go | 3 --- cli/command/defaultcontextstore_test.go | 3 --- cli/command/formatter/buildcache.go | 3 --- cli/command/formatter/container.go | 3 --- cli/command/formatter/container_test.go | 3 --- cli/command/formatter/custom.go | 3 --- cli/command/formatter/displayutils.go | 3 --- cli/command/formatter/formatter.go | 3 --- cli/command/formatter/formatter_test.go | 3 --- cli/command/formatter/reflect.go | 3 --- cli/command/formatter/reflect_test.go | 3 --- cli/command/formatter/volume.go | 3 --- cli/command/formatter/volume_test.go | 3 --- cli/command/idresolver/idresolver.go | 3 --- cli/command/image/build.go | 3 --- cli/command/image/build/internal/git/gitutils.go | 3 --- cli/command/image/inspect.go | 3 --- cli/command/image/list.go | 3 --- cli/command/image/push.go | 3 --- cli/command/image/tree.go | 3 --- cli/command/inspect/inspector.go | 3 --- cli/command/manifest/annotate.go | 3 --- cli/command/network/formatter.go | 3 --- cli/command/network/formatter_test.go | 3 --- cli/command/network/inspect.go | 3 --- cli/command/network/list.go | 3 --- cli/command/node/formatter_test.go | 3 --- cli/command/node/inspect.go | 3 --- cli/command/node/list.go | 3 --- cli/command/node/update.go | 3 --- cli/command/plugin/formatter_test.go | 3 --- cli/command/plugin/inspect.go | 3 --- cli/command/plugin/list.go | 3 --- cli/command/secret/formatter.go | 3 --- cli/command/secret/inspect.go | 3 --- cli/command/secret/ls.go | 3 --- cli/command/service/formatter.go | 3 --- cli/command/service/formatter_test.go | 3 --- cli/command/service/inspect.go | 3 --- cli/command/service/inspect_test.go | 3 --- cli/command/service/internal/genericresource/parse.go | 3 --- cli/command/service/logs.go | 3 --- cli/command/service/opts.go | 3 --- cli/command/service/progress/progress.go | 3 --- cli/command/service/update.go | 3 --- cli/command/stack/list.go | 3 --- cli/command/stack/loader.go | 3 --- cli/command/stack/remove.go | 3 --- cli/command/stack/services.go | 3 --- cli/command/system/events.go | 3 --- cli/command/system/info.go | 3 --- cli/command/system/inspect.go | 3 --- cli/command/system/prune.go | 3 --- cli/command/system/pruner/pruner.go | 3 --- cli/command/system/version.go | 3 --- cli/command/task/print.go | 3 --- cli/command/telemetry_docker.go | 3 --- cli/command/utils.go | 3 --- cli/command/volume/create.go | 3 --- cli/command/volume/create_test.go | 3 --- cli/command/volume/inspect.go | 3 --- cli/command/volume/list.go | 3 --- cli/compose/convert/service.go | 3 --- cli/compose/interpolation/interpolation.go | 3 --- cli/compose/interpolation/interpolation_test.go | 3 --- cli/compose/loader/full-struct_test.go | 3 --- cli/compose/loader/interpolate.go | 3 --- cli/compose/loader/loader.go | 3 --- cli/compose/loader/loader_test.go | 3 --- cli/compose/loader/merge.go | 3 --- cli/compose/loader/merge_test.go | 3 --- cli/compose/schema/schema.go | 3 --- cli/compose/schema/schema_test.go | 3 --- cli/compose/template/template.go | 3 --- cli/compose/template/template_test.go | 3 --- cli/compose/types/types.go | 3 --- cli/config/configfile/file.go | 3 --- cli/config/memorystore/store.go | 3 --- cli/connhelper/connhelper.go | 3 --- cli/connhelper/ssh/ssh.go | 3 --- cli/context/store/metadata_test.go | 3 --- cli/context/store/metadatastore.go | 3 --- cli/context/store/store.go | 3 --- cli/context/store/store_test.go | 3 --- cli/context/store/storeconfig.go | 3 --- cli/context/store/storeconfig_test.go | 3 --- cli/streams/stream.go | 3 --- cmd/docker-trust/internal/registry/config.go | 3 --- cmd/docker-trust/internal/registry/errors.go | 3 --- cmd/docker-trust/trust/inspect.go | 3 --- cmd/docker/builder_test.go | 3 --- cmd/docker/docker.go | 3 --- internal/oauth/api/api.go | 3 --- internal/registry/config.go | 3 --- internal/registry/errors.go | 3 --- internal/registryclient/fetcher.go | 3 --- internal/test/strings.go | 3 --- internal/tui/chip.go | 3 --- internal/tui/colors.go | 3 --- internal/tui/count.go | 3 --- internal/tui/note.go | 3 --- internal/tui/output.go | 3 --- internal/tui/str.go | 3 --- internal/volumespec/volumespec.go | 3 --- opts/capabilities.go | 3 --- opts/gpus.go | 3 --- opts/network.go | 3 --- opts/opts.go | 3 --- opts/swarmopts/port.go | 3 --- opts/swarmopts/port_test.go | 3 --- opts/ulimit.go | 3 --- templates/templates.go | 3 --- 140 files changed, 420 deletions(-) diff --git a/cli-plugins/hooks/hook_types.go b/cli-plugins/hooks/hook_types.go index 03ee7294935a..528febd0222c 100644 --- a/cli-plugins/hooks/hook_types.go +++ b/cli-plugins/hooks/hook_types.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - // Package hooks defines the contract between the Docker CLI and CLI plugin hook // implementations. // diff --git a/cli-plugins/hooks/template.go b/cli-plugins/hooks/template.go index 99abb9acf828..1d676107754b 100644 --- a/cli-plugins/hooks/template.go +++ b/cli-plugins/hooks/template.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package hooks import ( diff --git a/cli-plugins/manager/error.go b/cli-plugins/manager/error.go index 5e66078b64a8..6cda9dc6f3f1 100644 --- a/cli-plugins/manager/error.go +++ b/cli-plugins/manager/error.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package manager import ( diff --git a/cli-plugins/manager/hooks.go b/cli-plugins/manager/hooks.go index 9a5800a4d7f6..08e224685dc9 100644 --- a/cli-plugins/manager/hooks.go +++ b/cli-plugins/manager/hooks.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package manager import ( diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index 17b333b41dcc..74687a334aa1 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package manager import ( diff --git a/cli-plugins/manager/plugin.go b/cli-plugins/manager/plugin.go index 41b4ed652d41..9b3e8158d383 100644 --- a/cli-plugins/manager/plugin.go +++ b/cli-plugins/manager/plugin.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package manager import ( diff --git a/cli-plugins/metadata/metadata.go b/cli-plugins/metadata/metadata.go index c35a5ad02890..634247f29572 100644 --- a/cli-plugins/metadata/metadata.go +++ b/cli-plugins/metadata/metadata.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package metadata const ( diff --git a/cli-plugins/plugin/plugin.go b/cli-plugins/plugin/plugin.go index 30ba4bc627de..72b86708237a 100644 --- a/cli-plugins/plugin/plugin.go +++ b/cli-plugins/plugin/plugin.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package plugin import ( diff --git a/cli/cobra.go b/cli/cobra.go index c5fd2906316f..cfddaf23a5d1 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package cli import ( diff --git a/cli/command/cli.go b/cli/command/cli.go index 2191893a93fe..3968ec4be35a 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/config/formatter.go b/cli/command/config/formatter.go index 23f0d6ae1235..48c2df180fb1 100644 --- a/cli/command/config/formatter.go +++ b/cli/command/config/formatter.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package config import ( diff --git a/cli/command/config/inspect.go b/cli/command/config/inspect.go index 36ba3913df5a..bd78df3e2a01 100644 --- a/cli/command/config/inspect.go +++ b/cli/command/config/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package config import ( diff --git a/cli/command/config/ls.go b/cli/command/config/ls.go index d03e83f2e37a..dbfbd2a96152 100644 --- a/cli/command/config/ls.go +++ b/cli/command/config/ls.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package config import ( diff --git a/cli/command/container/completion.go b/cli/command/container/completion.go index de4ccd06071d..32749ecb7ab5 100644 --- a/cli/command/container/completion.go +++ b/cli/command/container/completion.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/inspect.go b/cli/command/container/inspect.go index eafcdcf742a9..81797e6ed321 100644 --- a/cli/command/container/inspect.go +++ b/cli/command/container/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index ebf00288b92f..88835f778a44 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/port.go b/cli/command/container/port.go index 86c4fb048ac0..ed3863dc5177 100644 --- a/cli/command/container/port.go +++ b/cli/command/container/port.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/start.go b/cli/command/container/start.go index d1119566e7c7..216ee280627a 100644 --- a/cli/command/container/start.go +++ b/cli/command/container/start.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/stats.go b/cli/command/container/stats.go index 8d7db38c6540..2110fec5f652 100644 --- a/cli/command/container/stats.go +++ b/cli/command/container/stats.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/container/tty.go b/cli/command/container/tty.go index 67fad6e3b909..dddba330328c 100644 --- a/cli/command/container/tty.go +++ b/cli/command/container/tty.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package container import ( diff --git a/cli/command/context.go b/cli/command/context.go index 7e4f4681fc5d..3f02a55125b2 100644 --- a/cli/command/context.go +++ b/cli/command/context.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/context/completion.go b/cli/command/context/completion.go index 5c9126c7ba6d..d0769ef7cb22 100644 --- a/cli/command/context/completion.go +++ b/cli/command/context/completion.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context/create.go b/cli/command/context/create.go index fd07b9c0938d..396dd42e2c04 100644 --- a/cli/command/context/create.go +++ b/cli/command/context/create.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context/create_test.go b/cli/command/context/create_test.go index e7114b461b6e..af7ab52e30f6 100644 --- a/cli/command/context/create_test.go +++ b/cli/command/context/create_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context/inspect.go b/cli/command/context/inspect.go index 0fc22e600f86..6d025e4df70d 100644 --- a/cli/command/context/inspect.go +++ b/cli/command/context/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context/list.go b/cli/command/context/list.go index db7fe1061ba3..330835325162 100644 --- a/cli/command/context/list.go +++ b/cli/command/context/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context/options.go b/cli/command/context/options.go index 563f019a6cea..48d84f38e174 100644 --- a/cli/command/context/options.go +++ b/cli/command/context/options.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package context import ( diff --git a/cli/command/context_test.go b/cli/command/context_test.go index 993d79a92e9b..333bbbcb7fce 100644 --- a/cli/command/context_test.go +++ b/cli/command/context_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/defaultcontextstore.go b/cli/command/defaultcontextstore.go index 41f34efec802..6fa3b29354fc 100644 --- a/cli/command/defaultcontextstore.go +++ b/cli/command/defaultcontextstore.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/defaultcontextstore_test.go b/cli/command/defaultcontextstore_test.go index f0e8b1ef7891..97cbd14f59eb 100644 --- a/cli/command/defaultcontextstore_test.go +++ b/cli/command/defaultcontextstore_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/formatter/buildcache.go b/cli/command/formatter/buildcache.go index d63cf05d63a3..fe7ad139aa2a 100644 --- a/cli/command/formatter/buildcache.go +++ b/cli/command/formatter/buildcache.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/container.go b/cli/command/formatter/container.go index 7b77a8a75375..9c563a51e94c 100644 --- a/cli/command/formatter/container.go +++ b/cli/command/formatter/container.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/container_test.go b/cli/command/formatter/container_test.go index 38859c30e126..62192d881652 100644 --- a/cli/command/formatter/container_test.go +++ b/cli/command/formatter/container_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/custom.go b/cli/command/formatter/custom.go index 80a716230b99..01be71e0d30e 100644 --- a/cli/command/formatter/custom.go +++ b/cli/command/formatter/custom.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import "strings" diff --git a/cli/command/formatter/displayutils.go b/cli/command/formatter/displayutils.go index d17b432633f5..96783b7c298a 100644 --- a/cli/command/formatter/displayutils.go +++ b/cli/command/formatter/displayutils.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/formatter.go b/cli/command/formatter/formatter.go index 52459441badd..353b5be75f70 100644 --- a/cli/command/formatter/formatter.go +++ b/cli/command/formatter/formatter.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/formatter_test.go b/cli/command/formatter/formatter_test.go index 0c1675417de8..8058956444e8 100644 --- a/cli/command/formatter/formatter_test.go +++ b/cli/command/formatter/formatter_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/reflect.go b/cli/command/formatter/reflect.go index bb17584209c0..dfdb5ca3346e 100644 --- a/cli/command/formatter/reflect.go +++ b/cli/command/formatter/reflect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/reflect_test.go b/cli/command/formatter/reflect_test.go index 3e1e4405a6fb..36a66669f71a 100644 --- a/cli/command/formatter/reflect_test.go +++ b/cli/command/formatter/reflect_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/volume.go b/cli/command/formatter/volume.go index d55d3677cb77..2b0b255ca780 100644 --- a/cli/command/formatter/volume.go +++ b/cli/command/formatter/volume.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/formatter/volume_test.go b/cli/command/formatter/volume_test.go index 4c16d04f8930..ceed805872e5 100644 --- a/cli/command/formatter/volume_test.go +++ b/cli/command/formatter/volume_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package formatter import ( diff --git a/cli/command/idresolver/idresolver.go b/cli/command/idresolver/idresolver.go index 2ee6d2c88eee..3a82ee2ff572 100644 --- a/cli/command/idresolver/idresolver.go +++ b/cli/command/idresolver/idresolver.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package idresolver import ( diff --git a/cli/command/image/build.go b/cli/command/image/build.go index 53883f70b80f..0c5280a50e5f 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package image import ( diff --git a/cli/command/image/build/internal/git/gitutils.go b/cli/command/image/build/internal/git/gitutils.go index 82b7188324c2..cc1b617c20e6 100644 --- a/cli/command/image/build/internal/git/gitutils.go +++ b/cli/command/image/build/internal/git/gitutils.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package git import ( diff --git a/cli/command/image/inspect.go b/cli/command/image/inspect.go index d9855e662b67..f238a41d0819 100644 --- a/cli/command/image/inspect.go +++ b/cli/command/image/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package image import ( diff --git a/cli/command/image/list.go b/cli/command/image/list.go index 5c877bf65fd5..bbd9e84476f9 100644 --- a/cli/command/image/list.go +++ b/cli/command/image/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package image import ( diff --git a/cli/command/image/push.go b/cli/command/image/push.go index f97cecb1386f..e42913186c13 100644 --- a/cli/command/image/push.go +++ b/cli/command/image/push.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package image import ( diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index 753792fb273f..6eeb239391e8 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package image import ( diff --git a/cli/command/inspect/inspector.go b/cli/command/inspect/inspector.go index 049941c27af7..530f39ca4591 100644 --- a/cli/command/inspect/inspector.go +++ b/cli/command/inspect/inspector.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package inspect import ( diff --git a/cli/command/manifest/annotate.go b/cli/command/manifest/annotate.go index ad0855b05356..dd41e6699b59 100644 --- a/cli/command/manifest/annotate.go +++ b/cli/command/manifest/annotate.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package manifest import ( diff --git a/cli/command/network/formatter.go b/cli/command/network/formatter.go index 335d0b200b46..39a7703171be 100644 --- a/cli/command/network/formatter.go +++ b/cli/command/network/formatter.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package network import ( diff --git a/cli/command/network/formatter_test.go b/cli/command/network/formatter_test.go index a93ad32e5f2e..c77038402a4b 100644 --- a/cli/command/network/formatter_test.go +++ b/cli/command/network/formatter_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package network import ( diff --git a/cli/command/network/inspect.go b/cli/command/network/inspect.go index 4f4fbf5b2d2f..d16e5b56e762 100644 --- a/cli/command/network/inspect.go +++ b/cli/command/network/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package network import ( diff --git a/cli/command/network/list.go b/cli/command/network/list.go index a4f31937d595..67079b9f90d2 100644 --- a/cli/command/network/list.go +++ b/cli/command/network/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package network import ( diff --git a/cli/command/node/formatter_test.go b/cli/command/node/formatter_test.go index b4b6253f652e..932af62beb32 100644 --- a/cli/command/node/formatter_test.go +++ b/cli/command/node/formatter_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package node import ( diff --git a/cli/command/node/inspect.go b/cli/command/node/inspect.go index 872dddf5c30b..fbddd32b7e7d 100644 --- a/cli/command/node/inspect.go +++ b/cli/command/node/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package node import ( diff --git a/cli/command/node/list.go b/cli/command/node/list.go index 09ffa9a79144..c6ea59a41b5b 100644 --- a/cli/command/node/list.go +++ b/cli/command/node/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package node import ( diff --git a/cli/command/node/update.go b/cli/command/node/update.go index 9cba9f5c1463..5f22f532f52e 100644 --- a/cli/command/node/update.go +++ b/cli/command/node/update.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package node import ( diff --git a/cli/command/plugin/formatter_test.go b/cli/command/plugin/formatter_test.go index 8b35c2e6f0ac..c582025543c9 100644 --- a/cli/command/plugin/formatter_test.go +++ b/cli/command/plugin/formatter_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package plugin import ( diff --git a/cli/command/plugin/inspect.go b/cli/command/plugin/inspect.go index 331422dc844a..2def6bebfee0 100644 --- a/cli/command/plugin/inspect.go +++ b/cli/command/plugin/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package plugin import ( diff --git a/cli/command/plugin/list.go b/cli/command/plugin/list.go index edb0aadcee7f..1b2c21735a8e 100644 --- a/cli/command/plugin/list.go +++ b/cli/command/plugin/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package plugin import ( diff --git a/cli/command/secret/formatter.go b/cli/command/secret/formatter.go index 9ebb3febe61e..fd5d41f42b11 100644 --- a/cli/command/secret/formatter.go +++ b/cli/command/secret/formatter.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package secret import ( diff --git a/cli/command/secret/inspect.go b/cli/command/secret/inspect.go index d8add51b847e..e8c72badf9da 100644 --- a/cli/command/secret/inspect.go +++ b/cli/command/secret/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package secret import ( diff --git a/cli/command/secret/ls.go b/cli/command/secret/ls.go index 819303d6d9ce..3d049d30cd03 100644 --- a/cli/command/secret/ls.go +++ b/cli/command/secret/ls.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package secret import ( diff --git a/cli/command/service/formatter.go b/cli/command/service/formatter.go index 4cd7e0552752..47f030cd76e7 100644 --- a/cli/command/service/formatter.go +++ b/cli/command/service/formatter.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/formatter_test.go b/cli/command/service/formatter_test.go index a8170ca4f614..6cb727cee898 100644 --- a/cli/command/service/formatter_test.go +++ b/cli/command/service/formatter_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/inspect.go b/cli/command/service/inspect.go index dacf3dec7957..0915e5c237ab 100644 --- a/cli/command/service/inspect.go +++ b/cli/command/service/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/inspect_test.go b/cli/command/service/inspect_test.go index fd36d9bef3cc..6fd86b677478 100644 --- a/cli/command/service/inspect_test.go +++ b/cli/command/service/inspect_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/internal/genericresource/parse.go b/cli/command/service/internal/genericresource/parse.go index 9cbaa997af4a..41a270c1b2e2 100644 --- a/cli/command/service/internal/genericresource/parse.go +++ b/cli/command/service/internal/genericresource/parse.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - // Package genericresource is a local fork of SwarmKit's [genericresource] package, // without protobuf dependencies. // diff --git a/cli/command/service/logs.go b/cli/command/service/logs.go index d410c7a3299e..23d0bd54644d 100644 --- a/cli/command/service/logs.go +++ b/cli/command/service/logs.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/opts.go b/cli/command/service/opts.go index b53f6652a042..ffa324d08a19 100644 --- a/cli/command/service/opts.go +++ b/cli/command/service/opts.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/service/progress/progress.go b/cli/command/service/progress/progress.go index 691f127a9d50..150a687512ff 100644 --- a/cli/command/service/progress/progress.go +++ b/cli/command/service/progress/progress.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package progress import ( diff --git a/cli/command/service/update.go b/cli/command/service/update.go index e70e1590f732..587ab589750f 100644 --- a/cli/command/service/update.go +++ b/cli/command/service/update.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package service import ( diff --git a/cli/command/stack/list.go b/cli/command/stack/list.go index ed361f34ec4e..c956d4804647 100644 --- a/cli/command/stack/list.go +++ b/cli/command/stack/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package stack import ( diff --git a/cli/command/stack/loader.go b/cli/command/stack/loader.go index 9b32f35268d3..9cf49a1d8761 100644 --- a/cli/command/stack/loader.go +++ b/cli/command/stack/loader.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package stack import ( diff --git a/cli/command/stack/remove.go b/cli/command/stack/remove.go index 1722fb67565d..b34b29187e47 100644 --- a/cli/command/stack/remove.go +++ b/cli/command/stack/remove.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package stack import ( diff --git a/cli/command/stack/services.go b/cli/command/stack/services.go index 62dbdffbed74..1c2b49e38b6b 100644 --- a/cli/command/stack/services.go +++ b/cli/command/stack/services.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package stack import ( diff --git a/cli/command/system/events.go b/cli/command/system/events.go index 351450f6bfca..ff7d81de5119 100644 --- a/cli/command/system/events.go +++ b/cli/command/system/events.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package system import ( diff --git a/cli/command/system/info.go b/cli/command/system/info.go index e4e3ec37bb7f..a8e013d19a10 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package system import ( diff --git a/cli/command/system/inspect.go b/cli/command/system/inspect.go index ee70a4af7f02..b56dcba12e73 100644 --- a/cli/command/system/inspect.go +++ b/cli/command/system/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package system import ( diff --git a/cli/command/system/prune.go b/cli/command/system/prune.go index 58a96f017bc4..9a50868a42da 100644 --- a/cli/command/system/prune.go +++ b/cli/command/system/prune.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package system import ( diff --git a/cli/command/system/pruner/pruner.go b/cli/command/system/pruner/pruner.go index 8e59b8005474..fccf085859da 100644 --- a/cli/command/system/pruner/pruner.go +++ b/cli/command/system/pruner/pruner.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - // Package pruner registers "prune" functions to be included as part of // "docker system prune". package pruner diff --git a/cli/command/system/version.go b/cli/command/system/version.go index 80fe30ea652b..d89e0d24c82a 100644 --- a/cli/command/system/version.go +++ b/cli/command/system/version.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package system import ( diff --git a/cli/command/task/print.go b/cli/command/task/print.go index baa4ca733241..2147180c5f41 100644 --- a/cli/command/task/print.go +++ b/cli/command/task/print.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package task import ( diff --git a/cli/command/telemetry_docker.go b/cli/command/telemetry_docker.go index b262e62e2197..d7074423cc03 100644 --- a/cli/command/telemetry_docker.go +++ b/cli/command/telemetry_docker.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/utils.go b/cli/command/utils.go index 530b669663d4..e48698cbf44a 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package command import ( diff --git a/cli/command/volume/create.go b/cli/command/volume/create.go index b514e587ff2e..097ad18b26fc 100644 --- a/cli/command/volume/create.go +++ b/cli/command/volume/create.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package volume import ( diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index fa860cd7dda1..03d32d9726c2 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package volume import ( diff --git a/cli/command/volume/inspect.go b/cli/command/volume/inspect.go index 9095ee516ce9..dfa4a42329ba 100644 --- a/cli/command/volume/inspect.go +++ b/cli/command/volume/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package volume import ( diff --git a/cli/command/volume/list.go b/cli/command/volume/list.go index b8bafaef4112..e5c0be16e56a 100644 --- a/cli/command/volume/list.go +++ b/cli/command/volume/list.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package volume import ( diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index 29732fa1903a..6817fd9a7562 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package convert import ( diff --git a/cli/compose/interpolation/interpolation.go b/cli/compose/interpolation/interpolation.go index 8f9496a8c71b..25e94db69e23 100644 --- a/cli/compose/interpolation/interpolation.go +++ b/cli/compose/interpolation/interpolation.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package interpolation import ( diff --git a/cli/compose/interpolation/interpolation_test.go b/cli/compose/interpolation/interpolation_test.go index a5538836e3f4..4b74dc352dc2 100644 --- a/cli/compose/interpolation/interpolation_test.go +++ b/cli/compose/interpolation/interpolation_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package interpolation import ( diff --git a/cli/compose/loader/full-struct_test.go b/cli/compose/loader/full-struct_test.go index ee3486385e8e..099e7a8290bb 100644 --- a/cli/compose/loader/full-struct_test.go +++ b/cli/compose/loader/full-struct_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/loader/interpolate.go b/cli/compose/loader/interpolate.go index 2f5861d47915..e22b86c64a5d 100644 --- a/cli/compose/loader/interpolate.go +++ b/cli/compose/loader/interpolate.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index 0f43d22ca9cb..8bb633294223 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 86dd77562474..b75c0f8dde37 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index 818574b0413c..1a523519448e 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/loader/merge_test.go b/cli/compose/loader/merge_test.go index 934ffe79a77b..c696cac82ab5 100644 --- a/cli/compose/loader/merge_test.go +++ b/cli/compose/loader/merge_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package loader import ( diff --git a/cli/compose/schema/schema.go b/cli/compose/schema/schema.go index f42130a0de4c..eb85b72e9795 100644 --- a/cli/compose/schema/schema.go +++ b/cli/compose/schema/schema.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package schema import ( diff --git a/cli/compose/schema/schema_test.go b/cli/compose/schema/schema_test.go index cef3d55223b9..195141923691 100644 --- a/cli/compose/schema/schema_test.go +++ b/cli/compose/schema/schema_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package schema import ( diff --git a/cli/compose/template/template.go b/cli/compose/template/template.go index f5217bb60482..26701bb20e8d 100644 --- a/cli/compose/template/template.go +++ b/cli/compose/template/template.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package template import ( diff --git a/cli/compose/template/template_test.go b/cli/compose/template/template_test.go index 0b2d463ebbe8..8e6a3392109f 100644 --- a/cli/compose/template/template_test.go +++ b/cli/compose/template/template_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package template import ( diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index f28f6e5748c4..1c9d86698b18 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package types import ( diff --git a/cli/config/configfile/file.go b/cli/config/configfile/file.go index 9babe40b2c30..88e6a68058a3 100644 --- a/cli/config/configfile/file.go +++ b/cli/config/configfile/file.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package configfile import ( diff --git a/cli/config/memorystore/store.go b/cli/config/memorystore/store.go index badabdf4d818..cb5eee13a1db 100644 --- a/cli/config/memorystore/store.go +++ b/cli/config/memorystore/store.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package memorystore import ( diff --git a/cli/connhelper/connhelper.go b/cli/connhelper/connhelper.go index aae7fb9a381d..3fce5c69e775 100644 --- a/cli/connhelper/connhelper.go +++ b/cli/connhelper/connhelper.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - // Package connhelper provides helpers for connecting to a remote daemon host with custom logic. package connhelper diff --git a/cli/connhelper/ssh/ssh.go b/cli/connhelper/ssh/ssh.go index 7ce8ba8d3def..0be837fc7248 100644 --- a/cli/connhelper/ssh/ssh.go +++ b/cli/connhelper/ssh/ssh.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - // Package ssh provides the connection helper for ssh:// URL. package ssh diff --git a/cli/context/store/metadata_test.go b/cli/context/store/metadata_test.go index 8c6389894b2d..c896f500f6f1 100644 --- a/cli/context/store/metadata_test.go +++ b/cli/context/store/metadata_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store import ( diff --git a/cli/context/store/metadatastore.go b/cli/context/store/metadatastore.go index 1751e820690b..7e74f3fb7e07 100644 --- a/cli/context/store/metadatastore.go +++ b/cli/context/store/metadatastore.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store import ( diff --git a/cli/context/store/store.go b/cli/context/store/store.go index 4122e077927f..33e2f2997a2b 100644 --- a/cli/context/store/store.go +++ b/cli/context/store/store.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store import ( diff --git a/cli/context/store/store_test.go b/cli/context/store/store_test.go index 25bfd87c75c0..371b3b5eefbe 100644 --- a/cli/context/store/store_test.go +++ b/cli/context/store/store_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store import ( diff --git a/cli/context/store/storeconfig.go b/cli/context/store/storeconfig.go index 79fb2da3f9bf..90344c150b77 100644 --- a/cli/context/store/storeconfig.go +++ b/cli/context/store/storeconfig.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store // TypeGetter is a func used to determine the concrete type of a context or diff --git a/cli/context/store/storeconfig_test.go b/cli/context/store/storeconfig_test.go index 51b5758e94ab..bb4069b8d89f 100644 --- a/cli/context/store/storeconfig_test.go +++ b/cli/context/store/storeconfig_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package store import ( diff --git a/cli/streams/stream.go b/cli/streams/stream.go index 8a357718d586..76a8263c978c 100644 --- a/cli/streams/stream.go +++ b/cli/streams/stream.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package streams import ( diff --git a/cmd/docker-trust/internal/registry/config.go b/cmd/docker-trust/internal/registry/config.go index 41f8e4b5f306..13209f456f64 100644 --- a/cmd/docker-trust/internal/registry/config.go +++ b/cmd/docker-trust/internal/registry/config.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package registry import ( diff --git a/cmd/docker-trust/internal/registry/errors.go b/cmd/docker-trust/internal/registry/errors.go index d0bdbe2e8315..d0b62dcf623a 100644 --- a/cmd/docker-trust/internal/registry/errors.go +++ b/cmd/docker-trust/internal/registry/errors.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package registry import ( diff --git a/cmd/docker-trust/trust/inspect.go b/cmd/docker-trust/trust/inspect.go index dcac604d2ca4..45c30eaf8a72 100644 --- a/cmd/docker-trust/trust/inspect.go +++ b/cmd/docker-trust/trust/inspect.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package trust import ( diff --git a/cmd/docker/builder_test.go b/cmd/docker/builder_test.go index 8eae0b048d3d..e3982381278e 100644 --- a/cmd/docker/builder_test.go +++ b/cmd/docker/builder_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package main import ( diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index a634d48de875..ac4b72f9d9a5 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package main import ( diff --git a/internal/oauth/api/api.go b/internal/oauth/api/api.go index 46e7d587f197..c108f57de327 100644 --- a/internal/oauth/api/api.go +++ b/internal/oauth/api/api.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package api import ( diff --git a/internal/registry/config.go b/internal/registry/config.go index 24b5eedfe3d6..3f9ad90fd034 100644 --- a/internal/registry/config.go +++ b/internal/registry/config.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package registry import ( diff --git a/internal/registry/errors.go b/internal/registry/errors.go index 7b12a8461f30..ddce5dd7b16f 100644 --- a/internal/registry/errors.go +++ b/internal/registry/errors.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package registry import ( diff --git a/internal/registryclient/fetcher.go b/internal/registryclient/fetcher.go index 09169fe44b52..0030e241c606 100644 --- a/internal/registryclient/fetcher.go +++ b/internal/registryclient/fetcher.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package registryclient import ( diff --git a/internal/test/strings.go b/internal/test/strings.go index cdf118dc09df..5f10a0a786b6 100644 --- a/internal/test/strings.go +++ b/internal/test/strings.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package test import ( diff --git a/internal/tui/chip.go b/internal/tui/chip.go index 893046264f04..416f96e66454 100644 --- a/internal/tui/chip.go +++ b/internal/tui/chip.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui import "strconv" diff --git a/internal/tui/colors.go b/internal/tui/colors.go index 2b6a0f1f30c4..fbd5072c64d6 100644 --- a/internal/tui/colors.go +++ b/internal/tui/colors.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui import ( diff --git a/internal/tui/count.go b/internal/tui/count.go index 05d034808df6..a015ce5cf1ea 100644 --- a/internal/tui/count.go +++ b/internal/tui/count.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui import ( diff --git a/internal/tui/note.go b/internal/tui/note.go index 1e2f538d9733..e914983fff04 100644 --- a/internal/tui/note.go +++ b/internal/tui/note.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui import ( diff --git a/internal/tui/output.go b/internal/tui/output.go index 4674ffae5bb5..3e73088a9642 100644 --- a/internal/tui/output.go +++ b/internal/tui/output.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui import ( diff --git a/internal/tui/str.go b/internal/tui/str.go index 819af243cd58..2cc9a3d787d7 100644 --- a/internal/tui/str.go +++ b/internal/tui/str.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package tui type Str struct { diff --git a/internal/volumespec/volumespec.go b/internal/volumespec/volumespec.go index 8f497714c83e..bcc10fd6bed3 100644 --- a/internal/volumespec/volumespec.go +++ b/internal/volumespec/volumespec.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package volumespec import ( diff --git a/opts/capabilities.go b/opts/capabilities.go index 96a0e7d0f4f9..6b25fba2a60c 100644 --- a/opts/capabilities.go +++ b/opts/capabilities.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package opts import ( diff --git a/opts/gpus.go b/opts/gpus.go index 3905a691aca5..7b1640660afb 100644 --- a/opts/gpus.go +++ b/opts/gpus.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package opts import ( diff --git a/opts/network.go b/opts/network.go index 51f50f2070b1..86ce43144145 100644 --- a/opts/network.go +++ b/opts/network.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package opts import ( diff --git a/opts/opts.go b/opts/opts.go index a57a27ee6d79..6e7937ce9bc6 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package opts import ( diff --git a/opts/swarmopts/port.go b/opts/swarmopts/port.go index 589c12795900..7ee5ff9fbf79 100644 --- a/opts/swarmopts/port.go +++ b/opts/swarmopts/port.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package swarmopts import ( diff --git a/opts/swarmopts/port_test.go b/opts/swarmopts/port_test.go index dd224f1e4cb7..928c668ae6d2 100644 --- a/opts/swarmopts/port_test.go +++ b/opts/swarmopts/port_test.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package swarmopts import ( diff --git a/opts/ulimit.go b/opts/ulimit.go index ba4a82c9d865..66d1080609ea 100644 --- a/opts/ulimit.go +++ b/opts/ulimit.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package opts import ( diff --git a/templates/templates.go b/templates/templates.go index 5443d70d7c77..0341c1a2e990 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.26 - package templates import (