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 <johnstep@docker.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit ec3f9230d70506c536a24e844da0f0b3af9b43f6) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
66720189e0
commit
ee508d47c3
|
@ -251,7 +251,7 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
|
||||||
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
|
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
|
||||||
$imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique
|
$imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique
|
||||||
# Filter out what we are looking for
|
# Filter out what we are looking for
|
||||||
$imports = $imports -NotMatch "^github.com/docker/docker/pkg/" `
|
$imports = @() + $imports -NotMatch "^github.com/docker/docker/pkg/" `
|
||||||
-NotMatch "^github.com/docker/docker/vendor" `
|
-NotMatch "^github.com/docker/docker/vendor" `
|
||||||
-Match "^github.com/docker/docker" `
|
-Match "^github.com/docker/docker" `
|
||||||
-Replace "`n", ""
|
-Replace "`n", ""
|
||||||
|
|
Loading…
Reference in New Issue