Build, Test & Lint
The Go extension keeps Go's normal tools but runs them through Putnami jobs.
Build
putnami build .
putnami build . --target linux/amd64Build behavior:
- optionally refreshes dependencies unless
--skip-depsis set - compiles packages and binaries
- supports cross-compilation through
--target - writes output to the job output directory or
--output
Useful options:
--target <os/arch>--output <path>--skip-deps--readonly--mod <readonly|vendor|mod>--ldflags,--gcflags,--asmflags,--tags--race,--trimpath,--buildmode,--cgo
Test
putnami test .
putnami test . --coverage
putnami test . --coverage-threshold 80Test behavior:
- runs Go tests with structured JSON output
- can generate coverage profile and HTML report
- parses results into Putnami diagnostics and metrics
Useful options:
--coverage--race--timeout <duration>--run <pattern>--count <n>--shuffle--bench <pattern>--coverage-threshold <pct>
Lint
putnami lint .
putnami lint . --tool golangci-lintLint runs golangci-lint, staticcheck, or both.
Config resolution for golangci-lint:
--config- project
.golangci.ymlor.golangci.yaml - workspace
.golangci.ymlor.golangci.yaml - bundled default config from
@putnami/go