Files
virtual-kubelet/scripts/validate/gomod.sh
Brian Goff 3840bc2666 Remove vendor/ (#688)
Vendoring seems to be problematic with go modules.
In addition to causing issues with transitive dependencies and being
problematic when trying to pull in the node-cli code, it also seems to
be pulling different versions than what is computed in go.mod.
This can be seen by comparing commits from the computed version in
go.mod with very small diffs (like a single Godep change in k8s) but massive
vendoring changes.

Basically I have very little confidence that this is even working.
This should be better in go1.13, but this is not released yet.
2019-07-02 18:04:40 +01:00

23 lines
443 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 || 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}