go
The Go toolchain: an exact upstream release, or the distribution package.
Installs the Go compiler and gofmt.
devtools:
- name: goVersion behaviour
version | Debian / Ubuntu | Alpine |
|---|---|---|
| omitted | the distribution’s golang-go package | the distribution’s go package |
| set | the official upstream tarball for that exact release, unpacked into /usr/local/go | the distribution package (the official tarball is glibc-only) |
A pinned version must be an exact upstream release number — 1.22.5, not 1.22
and not latest. The tarball is fetched for the workstation’s architecture and go and
gofmt are symlinked onto /usr/local/bin, so they are on every login shell’s PATH.
Example
A config that pins the toolchain for a Go service and its linter:
apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
name: go-dev
namespace: local
spec:
selector:
matchLabels:
stack: go
packages:
- git
devtools:
- name: go
version: "1.22.5"
- name: golangci-lint # picks up the toolchain installed aboveDeclaring go before golangci-lint matters: golangci-lint is installed with
the Go toolchain, and devtools install in declared order, so the pinned toolchain is
the one that builds it.
Notes
- Re-pinning the version reinstalls Go on the next setup run;
/usr/local/gois replaced, not merged. - The workstation is considered to have this devtool once
goresolves on PATH. - On Alpine the
versionfield is accepted but has no effect — the musl workstation always gets the distribution package.