From 1f7de4085d3b873c5e424e66a4be0553c64244ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20D=C3=BCren?= Date: Fri, 14 Mar 2025 23:07:06 +0100 Subject: [PATCH] Fix Go version compatibility by explicitly using Go 1.22.2 --- start.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/start.sh b/start.sh index e600ca1..48822fd 100644 --- a/start.sh +++ b/start.sh @@ -352,10 +352,10 @@ cd "$SERVER_DIR" # Set Go module cache to a writable location export GOPATH=/app/data/go export GO111MODULE=on -# Use local Go version instead of trying to download -export GOTOOLCHAIN=local -# Override version requirements -export GOFLAGS="-mod=mod" +# Explicitly use Go 1.22.2 +export GOTOOLCHAIN=go1.22.2 +# Override version requirements and force module mode +export GOFLAGS="-mod=mod -modcacherw" # Create a temporary directory for Go module cache and build in writable area export GOCACHE=/app/data/go/cache export GOMODCACHE=/app/data/go/modcache @@ -433,9 +433,9 @@ elif [ -d "$SERVER_DIR/cmd/museum" ]; then # Instead of modifying go.mod, set environment variables for compatibility echo "==> Setting Go environment variables for compatibility" - export GOFLAGS="-mod=mod" - # Use local Go version - export GOTOOLCHAIN=local + export GOFLAGS="-mod=mod -modcacherw" + # Explicitly use Go 1.22.2 + export GOTOOLCHAIN=go1.22.2 # For Wasabi specific settings if [[ "${S3_ENDPOINT}" == *"wasabi"* ]]; then @@ -513,8 +513,8 @@ else # Instead of trying to modify go.mod, set environment variables for compatibility echo "==> Setting Go environment variables for compatibility" - export GOFLAGS="-mod=mod" - export GOTOOLCHAIN=local + export GOFLAGS="-mod=mod -modcacherw" + export GOTOOLCHAIN=go1.22.2 echo "==> Running main.go with Go" /usr/local/bin/gosu cloudron:cloudron go run -mod=mod main.go --port 8000 \