diff --git a/scripts/install_native.sh b/scripts/install_native.sh index acd16b3..e0a7711 100755 --- a/scripts/install_native.sh +++ b/scripts/install_native.sh @@ -232,10 +232,9 @@ else echo 'export PATH=/usr/local/go/bin:$PATH' >> /etc/profile fi - # Add to current shell - if ! echo $PATH | grep -q "/usr/local/go/bin"; then - export PATH=/usr/local/go/bin:$PATH - fi + # Update PATH for current session and all subprocesses + export PATH=/usr/local/go/bin:$PATH + hash -r # Clear bash's command cache echo "✅ Go $LATEST_GO_VERSION installed" fi @@ -259,6 +258,17 @@ if [ "$SKIP_BUILD" = false ]; then # Fix Go module dependencies echo "📦 Updating Go module dependencies..." + + # Debug: show Go environment + echo "DEBUG: Go version: $(go version)" + echo "DEBUG: GOPATH: ${GOPATH:-'not set'}" + echo "DEBUG: GOROOT: $(go env GOROOT)" + echo "DEBUG: Current module: $(go list -m)" + echo "DEBUG: Working directory: $(pwd)" + + # Force Go to use module mode + export GO111MODULE=on + go mod tidy # Install Go dependencies