A development environment for Go projects. It provides the official Go toolchain,
the Go language server (gopls), manages module caches via persistent mounts,
and preserves Go environment settings across workshop updates.
A minimal workshop:
# workshop.yaml
name: go-app
base: ubuntu@24.04
sdks:
- name: go
channel: 1.24/stable
actions:
build: |
go build
test: |
go test ./...This demonstrates a basic Go build workflow with persistent module caching and
gopls available for editor integrations.
-
No prerequisite SDKs are required.
-
Your Go project (with a
go.modfile) should be in your project directory:git clone <YOUR_REPO_URL>
-
On launch, the SDK configures
PATHandGOMODCACHE. The SDK includes a pinnedgoplsbuild, so no language-server installation is needed. No project dependency download happens automatically; project dependencies are fetched during the firstgo build,go test, orgoplsworkspace load.
Once the workshop is ready:
workshop shell
go buildThe first build downloads dependencies into ~/go/pkg/mod, which is mapped to
your host via the mod-cache mount plug. Subsequent builds reuse cached
modules.
To see where the module cache is stored on the host:
workshop infoFrom within the workshop shell:
workshop shell
go test ./...
go run .Use standard Go commands; the toolchain behaves exactly as it would in a native Go installation.
The SDK includes a build of gopls, the official Go language server, tracking
the latest release that supports the SDK's Go version. Editors that connect to a
workshop can use the gopls binary on PATH without a manual install step:
workshop shell
gopls versionGo environment variables set via go env -w persist across workshop updates:
workshop shell
go env -w GOPRIVATE=github.com/yourorg/*These settings are automatically saved when the SDK is updated and restored when the workshop is refreshed.
- Interface:
mount - Workshop target:
/home/workshop/go/pkg/mod - Purpose: Persists Go module downloads between workshop updates.
This SDK doesn't define any slots.
- Go community: Go Forum
- Workshop forum: Discourse
- Please review our Code of Conduct before participating.
All contributions, including code, documentation updates, and issue reports, are welcome!
- See
CONTRIBUTING.mdfor guidelines. - Open issues or pull requests on the official repository.
Copyright 2025 Canonical Ltd.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1) as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.