Skip to content

Commit

Permalink
hack/make.ps1: fix Validate-PkgImports
Browse files Browse the repository at this point in the history
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]>
(cherry picked from commit ec3f923)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
johnstep authored and thaJeztah committed Apr 12, 2018
1 parent 6672018 commit ee508d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hack/make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
$imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique
# Filter out what we are looking for
$imports = $imports -NotMatch "^github.com/docker/docker/pkg/" `
-NotMatch "^github.com/docker/docker/vendor" `
-Match "^github.com/docker/docker" `
-Replace "`n", ""
$imports = @() + $imports -NotMatch "^github.com/docker/docker/pkg/" `
-NotMatch "^github.com/docker/docker/vendor" `
-Match "^github.com/docker/docker" `
-Replace "`n", ""
$imports | % { $badFiles+="$file imports $_`n" }
}
if ($badFiles.Length -eq 0) {
Expand Down

0 comments on commit ee508d4

Please sign in to comment.