Skip to content

Commit

Permalink
go get explicit versions to avoid ambiguous imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhita committed Jan 5, 2023
1 parent ad038c0 commit b2e6451
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions artifacts/scripts/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ update-deps-in-gomod() {
[ -s go.sum ] && rm go.sum

GO111MODULE=on GOPRIVATE="${dep_packages}" GOPROXY=https://proxy.golang.org go mod download
fixAmbiguousImports
GOPROXY="file://${GOPATH}/pkg/mod/cache/download,https://proxy.golang.org" GO111MODULE=on GOPRIVATE="${dep_packages}" go mod tidy

git add go.mod go.sum
Expand All @@ -853,6 +854,13 @@ update-deps-in-gomod() {
ensure-clean-working-dir
}

function fixAmbiguousImports() {
# ref: https://github.com/kubernetes/publishing-bot/issues/304
# TODO(nikhita): remove this when k/k drops or bumps
# cloud.google.com/go to a version > v0.105.0
go get cloud.google.com/go/compute/[email protected]
}

gomod-pseudo-version() {
TZ=GMT git show -q --pretty='format:v0.0.0-%cd-%h' --date='format-local:%Y%m%d%H%M%S' --abbrev=12
}
Expand Down

0 comments on commit b2e6451

Please sign in to comment.