From e6220b0e51712a101fac9e70d3509a0f1537c6b0 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Tue, 19 Nov 2019 11:14:41 -0800 Subject: [PATCH] Install vendored goimports prior to running it --- hack/verify-goimports | 10 ++++++++++ 1 file changed, 10 insertions(+) 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'))