Fix Go version compatibility by using local toolchain
This commit is contained in:
parent
4b7fb0fd9c
commit
cf7865b5d1
10
start.sh
10
start.sh
@ -352,8 +352,8 @@ cd "$SERVER_DIR"
|
|||||||
# Set Go module cache to a writable location
|
# Set Go module cache to a writable location
|
||||||
export GOPATH=/app/data/go
|
export GOPATH=/app/data/go
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
# Set version compatibility flags
|
# Use local Go version instead of trying to download
|
||||||
export GOTOOLCHAIN=auto
|
export GOTOOLCHAIN=local
|
||||||
# Override version requirements
|
# Override version requirements
|
||||||
export GOFLAGS="-mod=mod"
|
export GOFLAGS="-mod=mod"
|
||||||
# Create a temporary directory for Go module cache and build in writable area
|
# Create a temporary directory for Go module cache and build in writable area
|
||||||
@ -434,8 +434,8 @@ elif [ -d "$SERVER_DIR/cmd/museum" ]; then
|
|||||||
# Instead of modifying go.mod, set environment variables for compatibility
|
# Instead of modifying go.mod, set environment variables for compatibility
|
||||||
echo "==> Setting Go environment variables for compatibility"
|
echo "==> Setting Go environment variables for compatibility"
|
||||||
export GOFLAGS="-mod=mod"
|
export GOFLAGS="-mod=mod"
|
||||||
# Explicitly skip version check
|
# Use local Go version
|
||||||
export GOTOOLCHAIN=auto
|
export GOTOOLCHAIN=local
|
||||||
|
|
||||||
# For Wasabi specific settings
|
# For Wasabi specific settings
|
||||||
if [[ "${S3_ENDPOINT}" == *"wasabi"* ]]; then
|
if [[ "${S3_ENDPOINT}" == *"wasabi"* ]]; then
|
||||||
@ -514,7 +514,7 @@ else
|
|||||||
# Instead of trying to modify go.mod, set environment variables for compatibility
|
# Instead of trying to modify go.mod, set environment variables for compatibility
|
||||||
echo "==> Setting Go environment variables for compatibility"
|
echo "==> Setting Go environment variables for compatibility"
|
||||||
export GOFLAGS="-mod=mod"
|
export GOFLAGS="-mod=mod"
|
||||||
export GOTOOLCHAIN=auto
|
export GOTOOLCHAIN=local
|
||||||
|
|
||||||
echo "==> Running main.go with Go"
|
echo "==> Running main.go with Go"
|
||||||
/usr/local/bin/gosu cloudron:cloudron go run -mod=mod main.go --port 8000 \
|
/usr/local/bin/gosu cloudron:cloudron go run -mod=mod main.go --port 8000 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user