Go
Status
Section titled “Status”Version: 1.0.0 | Tests: Passing
{
"features": {
"ghcr.io/infrashift/trusted-devcontainer-features/golang:latest": {
"target_version": "1.26.0",
"target_checksum": "aac1b08a0fb0c4e0a7c1555beb7b59180b05dfc5a3d62e40e9de90cd42f88235"
}
}
} Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
target_version | string | 1.26.0 | Select a supported Golang binary version |
target_checksum | string | aac1b08a0fb0c4e0a7c1555beb7b59180b05dfc5a3d62e40e9de90cd42f88235 | Select the corresponding Golang binary checksum |
Dependencies
Section titled “Dependencies”None — this feature is independent and has no dependencies.
How It Works
Section titled “How It Works”This feature downloads the official Go binary distribution from go.dev as a tarball (go<version>.linux-amd64.tar.gz) and installs it into a user-local directory. Go is a statically typed, compiled language designed for simplicity and performance, widely used for cloud infrastructure tooling, container runtimes, and CLI applications.
The Ansible playbook creates ~/.local/share/go as the Go installation root, downloads the tarball for the specified version, and verifies the SHA256 checksum to ensure the download has not been tampered with. A default checksum is provided for the bundled version, but you can override it when pinning to a different version. After verification, the tarball is extracted into the installation directory.
The playbook configures GOPATH at ~/.local/share/gopath, which is where Go modules, build caches, and installed binaries are stored. Both the Go binary directory (~/.local/share/go/bin) and the GOPATH bin directory (~/.local/share/gopath/bin) are added to PATH, so the go command and any binaries installed via go install are immediately available. The VS Code Go extension is recommended for full language support including IntelliSense, debugging, and test integration.