diff --git a/hack/verify-goimports b/hack/verify-goimports index 8a5e0aaea84a7..4d2e4e86d68a6 100755 --- a/hack/verify-goimports +++ b/hack/verify-goimports @@ -34,6 +34,16 @@ for package in packages: continue paths.append(package) +# Install goimports from vendor +print('installing goimports from vendor') + +process = subprocess.Popen(['go', 'install', 'k8s.io/kops/vendor/golang.org/x/tools/cmd/goimports'], stdout=subprocess.PIPE, cwd=path.join(gopath, 'src')) +stdout, stderr = process.communicate() +if process.returncode != 0: + print("FAIL: installing goimports from vendor failed") + print(stderr) + sys.exit(1) + print("packages %s" % paths) process = subprocess.Popen(['goimports', '-l'] + paths, stdout=subprocess.PIPE, cwd=path.join(gopath, 'src'))