Browse code

hack/validate: remove obsolete exception

This was added in 20d594fb79949fe61a8cdfde52829ba7ef1a69ed, 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>

Sebastiaan van Stijn authored on 2025/07/23 06:58:28
Showing 3 changed files
... ...
@@ -256,15 +256,6 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
256 256
     $files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'pkg\*.go`'"
257 257
     $badFiles=@(); $files | ForEach-Object{
258 258
         $file=$_
259
-
260
-        if ($file -like "pkg\stdcopy\*") {
261
-            # Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
262
-            # because it's an alias for backward-compatibility.
263
-            #
264
-            # TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
265
-            return
266
-        }
267
-
268 259
         # For the current changed file, get its list of dependencies, sorted and uniqued.
269 260
         $imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file"
270 261
         if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
... ...
@@ -10,16 +10,6 @@ unset IFS
10 10
 
11 11
 badFiles=()
12 12
 for f in "${files[@]}"; do
13
-	case "$f" in
14
-		pkg/stdcopy/*)
15
-			# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
16
-			# because it's an alias for backward-compatibility.
17
-			#
18
-			# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
19
-			continue
20
-			;;
21
-	esac
22
-
23 13
 	IFS=$'\n'
24 14
 	badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \
25 15
 		| grep -vE '^github.com/docker/docker/pkg/' \
... ...
@@ -1,4 +1,4 @@
1
-package stdcopy // Deprecated: use [github.com/docker/docker/api/stdcopy] instead.
1
+package stdcopy // Deprecated: use [github.com/moby/moby/api/stdcopy] instead.
2 2
 
3 3
 import (
4 4
 	"io"
... ...
@@ -6,8 +6,6 @@ import (
6 6
 	"github.com/moby/moby/api/stdcopy"
7 7
 )
8 8
 
9
-// TODO(thaJeztah): remove exception in hack/make.ps1 and hack/validate/pkg-imports when removing.
10
-
11 9
 // StdType is the type of standard stream
12 10
 // a writer can multiplex to.
13 11
 //