Skip to content

Commit

Permalink
UPSTREAM: <carry>: scripts/test_lib.sh: skip go get if readonly
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
  • Loading branch information
hexfusion committed Aug 11, 2021
1 parent 347b463 commit f6c059d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ fi

VERSION_SYMBOL="${ROOT_MODULE}/api/v3/version.GitSHA"

GO_BUILD_FLAGS="${GO_BUILD_FLAGS} ${GOFLAGS:+-$GOFLAGS}"

# Set GO_LDFLAGS="-s" for building without symbols for debugging.
# shellcheck disable=SC2206
GO_LDFLAGS=(${GO_LDFLAGS} "-X=${VERSION_SYMBOL}=${GIT_SHA}")
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function tool_exists {
}

# Ensure gobin is available, as it runs majority of the tools
if ! command -v "gobin" >/dev/null; then
if ! command -v "gobin" >/dev/null && [[ ! "$GO_BUILD_FLAGS" =~ 'mod=readonly' ]]; then
run env GO111MODULE=off go get github.com/myitcv/gobin || exit 1
fi

Expand Down

0 comments on commit f6c059d

Please sign in to comment.