Go
Curated name go. Installs the Go toolchain via the upstream
devcontainers/features/go
feature, including golangci-lint.
Add it
Section titled “Add it”monoceros init acme --with-languages=gomonoceros add-language acme go:1.24Remove it
Section titled “Remove it”monoceros remove-language acme goOr delete the entry from acme.yml by hand and re-run monoceros apply acme -
the yml is the source of truth.
Pinning a version
Section titled “Pinning a version”monoceros add-language acme go:1.24Supported: 1.24, 1.23 (also latest).
Builds stay fast across rebuilds
Section titled “Builds stay fast across rebuilds”A Go build is only slow once. The build cache and the module cache live in a
volume shared by every workbench on the machine, so a dependency is downloaded
and compiled one time and then reused - by the next build, by the next
workbench, and after a monoceros apply recreates the container. On a
mid-sized project that is well over two gigabytes you do not pay for twice.
The tools a project installs itself stay per workbench:
go install golang.org/x/vuln/cmd/govulncheck@v1.3.0That lands in ~/go/bin, which is bound to your workbench directory and
survives a rebuild, so a make dev-tools-style setup step is a one-time thing
rather than something you repeat after every apply. Per workbench on purpose:
two projects can pin different versions of the same linter, and one shared
directory would only hold one of them. ~/go/bin also comes first on PATH,
ahead of the tools the upstream feature ships in /go/bin, so your pinned
version is the one that runs.
This needs runtime 1.6.2 or newer. Run
monoceros upgrade to move an older
workbench up.
Key options
Section titled “Key options”Set these by adding the feature directly (see Other feature options):
| Option | Default | Notes |
|---|---|---|
version | latest | Pin via the :version suffix instead. |
golangciLintVersion | latest | Pin the linter version. |
Full option list: upstream feature.