Skip to content

Commit ec3f923

Browse files
johnstepkolyshkin
authored andcommitted
hack/make.ps1: fix Validate-PkgImports
In Go 1.10.1, the Deps for pkg\tarsum\tarsum_test.go are empty ([]) and the PowerShell script ends up setting its import list to a string value of False instead of an empty array. This can be remedied by forcing the result to be an array, by concatenating to an empty array (@() + ...) Signed-off-by: John Stephens <[email protected]> Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 7b30fd0 commit ec3f923

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

hack/make.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
251251
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
252252
$imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique
253253
# Filter out what we are looking for
254-
$imports = $imports -NotMatch "^github.com/docker/docker/pkg/" `
255-
-NotMatch "^github.com/docker/docker/vendor" `
256-
-Match "^github.com/docker/docker" `
257-
-Replace "`n", ""
254+
$imports = @() + $imports -NotMatch "^github.com/docker/docker/pkg/" `
255+
-NotMatch "^github.com/docker/docker/vendor" `
256+
-Match "^github.com/docker/docker" `
257+
-Replace "`n", ""
258258
$imports | % { $badFiles+="$file imports $_`n" }
259259
}
260260
if ($badFiles.Length -eq 0) {

0 commit comments

Comments
 (0)