Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 2.32 KB

File metadata and controls

40 lines (28 loc) · 2.32 KB

Build Reference

All code in this repo is written in golang. The golang package is required to build and run the tools.

The build system uses mage, which can be installed with go install github.com/magefile/mage@latest. Alternatively, a zero-install approach is available through go run magefile.go or ./magefile.go, which automatically downloads the required dependencies without manual installation. All additional build tools are managed automatically by go, and no manual tool installation is required.

All other tooling dependencies are handled by go tool, which will automatically get the required tools when using mage. See the tools section for more information.

This repo contains configs for the golangci-lint linter. It is installed as part of the VSCode go extension. It's also optionally available as a binary release.

Mage Commands

Command Description When to Use
mage -l List all available targets To see all options
mage all Full build, test, and check pipeline Before submitting PR
mage build Build Go binaries After code changes
mage install Build Go binaries and install Outer-loop testing
mage unit Run unit tests After writing tests
mage scenario Run scenario tests (SLOW) For major changes
mage scenarioUpdate Update test snapshots When test expectations change
mage check all Run all quality checks Before committing
mage fix all Auto-fix code issues When linting fails
mage generate Run code generation Automatic with build/test

Note: Dependencies run automatically in correct order (i.e. mage build and mage unit automatically run code generation as needed).

Code Generation

The project uses automatic code generation including:

  • go:generate directives
  • Stringer for enums
  • Schema generation
  • Mocks generated by mockgen

You typically don't need to run mage generate manually as it's included in build dependencies.

See tools documentation for more details on how to use tools with go tool in go:generate directives.