This includes updates to CI config, vendor files, etc. I've hard-coded the k8s depedency at 1.13.4 to keep it inline with what we currently have and to make sure a another run of `go mod tidy` doesn't accidentally update it to an unexpected version. Thanks to hectorj2f for carrying this along.
23 lines
450 B
Bash
Executable File
23 lines
450 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
exit_code=0
|
|
|
|
echo "==> Running go mod tidy to add missing and remove unused modules <=="
|
|
|
|
GO111MODULE=on go mod tidy || exit_code=1
|
|
if [ $exit_code -ne 0 ]; then
|
|
echo 'Checking go.mod and go.sum files'
|
|
else
|
|
echo "go mod tidy passed."
|
|
fi
|
|
|
|
git diff --exit-code go.mod go.sum vendor || exit_code=$?
|
|
|
|
if [ ${exit_code} -eq 0 ]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo "please run \`go mod tidy\` and check in the changes"
|
|
exit ${exit_code}
|