go1.14: set -mod=mod while rebuilding/linting vendor and building licenses, preserve explicit imports in modules.txt

This commit is contained in:
Jordan Liggitt
2020-06-23 16:10:26 -04:00
parent 101653e5e8
commit 660c290bbf
3 changed files with 16 additions and 6 deletions

View File

@@ -27,8 +27,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
# Explicitly opt into go modules, even though we're inside a GOPATH directory
export GO111MODULE=on
# Explicitly clear GOFLAGS, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor
export GOFLAGS=
# Explicitly set GOFLAGS to ignore vendor, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor
export GOFLAGS=-mod=mod
# Detect problematic GOPROXY settings that prevent lookup of dependencies
if [[ "${GOPROXY:-}" == "off" ]]; then
kube::log::error "Cannot run with \$GOPROXY=off"