Go
Go is a statically typed, compiled language known for simplicity and excellent tooling. LumenFlow’s go preset provides sensible defaults for Go projects.
Quickstart
Section titled “Quickstart”-
Add preset to your configuration
-
Run gates
-
Done!
The preset runs
gofmt,golangci-lint,go vet, andgo testautomatically.
Preset Defaults
Section titled “Preset Defaults”The go preset uses these commands:
| Gate | Command | Description |
|---|---|---|
| Format | gofmt -l . | Check formatting (list unformatted files) |
| Lint | golangci-lint run | Run comprehensive linter suite |
| Typecheck | go vet ./... | Report likely mistakes in code |
| Test | go test ./... | Run all tests |
Custom Configuration
Section titled “Custom Configuration”Override specific commands while keeping preset defaults for others:
Full Custom Configuration
Section titled “Full Custom Configuration”For complete control, omit the preset and define all commands:
Common Patterns
Section titled “Common Patterns”With golangci-lint
Section titled “With golangci-lint”The recommended linting tool for Go projects:
Configure golangci-lint with .golangci.yml:
With Coverage
Section titled “With Coverage”Add test coverage reporting:
With Build Verification
Section titled “With Build Verification”Include build in your gates:
GitHub Action Example
Section titled “GitHub Action Example”Module Structure
Section titled “Module Structure”LumenFlow works well with standard Go module layouts:
Monorepo Support
Section titled “Monorepo Support”For Go monorepos or workspaces:
Or run gates per-module with the GitHub Action:
Troubleshooting
Section titled “Troubleshooting”gofmt reports files but gate passes
Section titled “gofmt reports files but gate passes”The default gofmt -l . lists unformatted files but returns exit code 0. Use:
This fails if any files need formatting.
golangci-lint timeout
Section titled “golangci-lint timeout”For large projects, increase the timeout:
Vendored dependencies
Section titled “Vendored dependencies”If using vendor/, exclude it from checks:
Next Steps
Section titled “Next Steps”- Gates Concepts - Understanding gates
- Configuration Reference - Full config schema
- GitHub Action - CI/CD integration