Skip to content

Commit

Permalink
revert revert
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Aug 11, 2023
1 parent f98877a commit f19abb5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/install-go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ GITHUB_PATH="${GITHUB_PATH:-/dev/null}"

add_to_github_path "$target_dir/bin"
PATH="$(add_to_system_path "$target_dir/bin")"
echo PATH="$PATH"

gopath=$(go env GOPATH)
go_exec="$target_dir/bin/$(exe_name go)"

gopath=$("$go_exec" env GOPATH)
mkdir -p "$gopath/bin"

add_to_github_path "$gopath/bin"
Expand All @@ -48,14 +49,15 @@ PATH="$(add_to_system_path "$gopath/bin")"
unset GOROOT

if [ -n "$INSTALL_GO_TIP" ]; then
GO111MODULE=off go get golang.org/dl/gotip
GO111MODULE=off "$go_exec" get golang.org/dl/gotip
"$gopath/bin/$(exe_name gotip)" download
rm -rf "$tip_target_dir"
mkdir -p "$(dirname "$tip_target_dir")"
mv "$(sdk_dir)/gotip" "$tip_target_dir"

add_to_github_path "$tip_target_dir/bin"
PATH="$(add_to_system_path "$tip_target_dir/bin")"
go_exec="$tip_target_dir/bin/$(exe_name go)"
fi

govars='GOCACHE
Expand All @@ -64,8 +66,8 @@ GOPATH
GOROOT
GOTOOLDIR'

echo "GOROOT=$(go env GOROOT)" >> "$GITHUB_ENV"
echo "GOROOT=$("$go_exec" env GOROOT)" >> "$GITHUB_ENV"

for var in $govars; do
echo "$var=$(go env "$var")" >> "$GITHUB_OUTPUT"
echo "$var=$("$go_exec" env "$var")" >> "$GITHUB_OUTPUT"
done

0 comments on commit f19abb5

Please sign in to comment.