Skip to content

Commit

Permalink
Install vendored goimports prior to running it
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Nov 19, 2019
1 parent ac01b6e commit 27b193e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hack/verify-goimports
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 27b193e

Please sign in to comment.