Skip to content

Go Stack Guide

This guide covers using Sequant with Go projects.

Sequant automatically detects Go projects by looking for:

  • go.mod

When initialized with the Go stack, Sequant configures these commands:

CommandDefault
Testgo test ./...
Buildgo build ./...
Lintgolangci-lint run
Formatgo fmt ./...

The workflow skills use these patterns to locate files:

PatternGlob
Source**/*.go
Tests**/*_test.go

During planning, Sequant will:

  • Review package structure
  • Check existing interfaces and types
  • Look for test patterns in *_test.go files

During implementation, the agent will:

  • Run golangci-lint run for linting
  • Run go test ./... for verification
  • Run go build ./... to ensure it compiles

Quality review includes:

  • golangci-lint checks
  • Go vet analysis
  • Test coverage review
  • Race condition detection (-race)

Override commands in .claude/.local/memory/constitution.md:

## Build Commands
- Test: `go test -v -race ./...`
- Build: `go build -o bin/ ./cmd/...`
- Lint: `golangci-lint run --enable-all`
cmd/
└── myapp/
└── main.go
internal/
├── config/
├── handlers/
└── models/
pkg/
└── utils/
go.mod
go.sum
main.go
config.go
handlers.go
handlers_test.go
go.mod
mylib.go
mylib_test.go
internal/
└── helpers.go
go.mod
  1. Use golangci-lint - Install it for comprehensive linting. Sequant expects it by default.

  2. Table-Driven Tests - The agent will follow Go conventions for table-driven tests.

  3. Interfaces - Define interfaces where consumers need them, not where implementations live.

  4. Error Handling - Use error wrapping with fmt.Errorf("context: %w", err) for better debugging.

  5. Packages - Keep package names short and lowercase; avoid stuttering (e.g., http.HTTPClient).

Create .golangci.yml for custom linting:

linters:
enable:
- gofmt
- govet
- errcheck
- staticcheck
- gosimple
- ineffassign
- unused
linters-settings:
govet:
check-shadowing: true