fix: rm -rf the base-image GOROOT before extract — overlaying two Go versions corrupts the stdlib (duplicate declarations)

This commit is contained in:
2026-10-31 08:55:35 +02:00
parent 715ab79600
commit a199e29dca
+1
View File
@@ -16,6 +16,7 @@ runs:
aarch64|arm64) arch=arm64 ;;
*) echo "better-setup-go: unsupported arch $(uname -m)" >&2; exit 1 ;;
esac
rm -rf /usr/local/go # a base-image GOROOT under the same path corrupts on overlay
curl -fsSL "https://go.dev/dl/go${v}.linux-${arch}.tar.gz" | tar -xz -C /usr/local
ln -sf /usr/local/go/bin/go /usr/local/bin/go
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt