Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retries failed go get requests. #229

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frontend/src/goutil
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -x
cd $1
shift


# Override these variables to make go not depend on HOME
mkdir -p /tmp/go
export GOPATH=/tmp/go
Expand All @@ -17,4 +18,13 @@ then
GOBIN=/usr/lib/go-1.13/bin/go
fi

version=`$GOBIN version | { read _ _ v _; echo ${v#go}; }`

if [[ "$version" > "1.15" ]]; then
# Temporary solution until https://github.com/golang/go/issues/28194 is fixed
# in order to retry failed fetch requests.
# GOPROXY fallback was added in Go 1.15
export GOPROXY="proxy.golang.org|proxy.golang.org|direct"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be worried about go 1.14?
The other branch of the if is for go 1.13, but the functionality you're using here is for 1.15+

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the logic, now based on the output of go version

fi

$GOBIN "$@"