Files

33 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2026-05-01 06:43:23 -04:00
# Go environment - sourced by /etc/profile for interactive login shells.
#
# All Go state lives under /usr/local/share/go (declared as a Docker
# VOLUME). The paths /go, /root/go, /root/.go, /root/.local/share/go and
# /data/go are symlinks to that location, so any of them can be used
# interchangeably and the data persists across container rebuilds when
# the volume is named.
#
# The Go distribution itself lives at /usr/local/go (baked into the image,
# not volumed). Tools installed at build time land in /usr/local/bin.
2026-05-01 06:43:23 -04:00
export GOPATH="${GOPATH:-/usr/local/share/go}"
export GOCACHE="${GOCACHE:-${GOPATH}/cache}"
export CGO_ENABLED="${CGO_ENABLED:-0}"
export GOTOOLCHAIN="${GOTOOLCHAIN:-auto}"
2026-05-30 23:15:20 -04:00
# Go distribution bin first, then baked tools, then GOPATH/bin last so a
# volume-mounted $GOPATH/bin never shadows baked image tools.
case ":${PATH}:" in
*":/usr/local/go/bin:"*) ;;
*) export PATH="/usr/local/go/bin:${PATH}" ;;
esac
2026-05-30 23:15:20 -04:00
case ":${PATH}:" in
*":/usr/local/bin:"*) ;;
*) export PATH="/usr/local/bin:${PATH}" ;;
esac
2026-05-01 06:43:23 -04:00
case ":${PATH}:" in
*":${GOPATH}/bin:"*) ;;
2026-05-30 23:15:20 -04:00
*) export PATH="${PATH}:${GOPATH}/bin" ;;
2026-05-01 06:43:23 -04:00
esac