initial commit [141.14.140.180,mike]
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Fetch latest version name (e.g., go1.26.2)
|
||||
RELEASE=$(curl -sL https://go.dev/VERSION?m=text | head -n 1)
|
||||
|
||||
# Detect OS and Architecture
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH=$(uname -m)
|
||||
[ "$ARCH" == "x86_64" ] && ARCH="amd64"
|
||||
[ "$ARCH" == "aarch64" ] && ARCH="arm64"
|
||||
|
||||
# Download and Extract
|
||||
|
||||
FILE="${RELEASE}.${OS}-${ARCH}.tar.gz"
|
||||
URL="https://go.dev/dl/$FILE"
|
||||
echo "Downloading $FILE $URL..."
|
||||
|
||||
wget $URL
|
||||
|
||||
rm -rf /db/go && tar -C /db -xzf $FILE
|
||||
|
||||
export PATH=/db/go/bin:~/go/bin:$PATH
|
||||
export CGO_ENABLED=0
|
||||
|
||||
/db/go/bin/go install golang.org/x/tools/cmd/goimports@latest
|
||||
Reference in New Issue
Block a user