hack/validate: remove obsolete exception

This was added in 20d594fb79, but was
written before the API module was added. Now that the API is a separate
module, the check will no longer flag packages importing the API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-07-22 23:58:28 +02:00
parent c55a163523
commit 01c7b4233c
3 changed files with 1 additions and 22 deletions

View File

@@ -256,15 +256,6 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
$files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'pkg\*.go`'"
$badFiles=@(); $files | ForEach-Object{
$file=$_
if ($file -like "pkg\stdcopy\*") {
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
# because it's an alias for backward-compatibility.
#
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
return
}
# For the current changed file, get its list of dependencies, sorted and uniqued.
$imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file"
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }

View File

@@ -10,16 +10,6 @@ unset IFS
badFiles=()
for f in "${files[@]}"; do
case "$f" in
pkg/stdcopy/*)
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
# because it's an alias for backward-compatibility.
#
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
continue
;;
esac
IFS=$'\n'
badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \
| grep -vE '^github.com/docker/docker/pkg/' \

View File

@@ -1,4 +1,4 @@
package stdcopy // Deprecated: use [github.com/docker/docker/api/stdcopy] instead.
package stdcopy // Deprecated: use [github.com/moby/moby/api/stdcopy] instead.
import (
"io"
@@ -6,8 +6,6 @@ import (
"github.com/moby/moby/api/stdcopy"
)
// TODO(thaJeztah): remove exception in hack/make.ps1 and hack/validate/pkg-imports when removing.
// StdType is the type of standard stream
// a writer can multiplex to.
//