From ee508d47c3917b423b6caae0ad2867c4f6ffe696 Mon Sep 17 00:00:00 2001 From: John Stephens Date: Wed, 11 Apr 2018 18:23:12 -0700 Subject: [PATCH] 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 Signed-off-by: Kir Kolyshkin (cherry picked from commit ec3f9230d70506c536a24e844da0f0b3af9b43f6) Signed-off-by: Sebastiaan van Stijn --- hack/make.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/make.ps1 b/hack/make.ps1 index 42a2b319fa..70b9a47726 100644 --- a/hack/make.ps1 +++ b/hack/make.ps1 @@ -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) {