Toolchain & Detection

The Go extension activates for Go projects in the workspace and resolves the Go toolchain automatically.

Project detection

Go projects are selected when the project contains Go source or module metadata, most commonly:

  • go.mod
  • *.go files
  • tests using the Go *_test.go convention

Templates create the expected shape:

putnami projects create api --template go-server
putnami projects create domain --template go-library

Toolchain resolution

The extension resolves Go in this order:

  1. workspace go.work directive
  2. project go.mod directive
  3. compatible Go from PATH
  4. managed download under .putnami/extensions/@putnami-go/
  5. latest stable Go when no version is pinned

GOCACHE and GOMODCACHE are shared at ~/.putnami/cache/go across every repository and worktree on the machine. Go's content keys isolate toolchains, targets, flags, and sources, so concurrent worktrees reuse compiled packages without mixing incompatible results. Set PUTNAMI_GO_CACHE_DIR to relocate the cache; putnami cache gc enforces its machine-wide 10 GiB budget.

Scope

The extension owns Go-specific jobs. Putnami still owns project selection, dependency ordering, cache reuse, and impacted-project detection.