Test:
go test ./... -race -covermode=atomic
Lint:
go vet ./...
golangci-lint run
Auto fix lint errors:
Note that only a few errors can be fixed by this command. Many lint errors needs to be fixed manually.
golangci-lint fmt
JSON Schema
If cmd/gen-jsonschema is present, JSON Schema for the application can be updated by the following command:
go run ./cmd/gen-jsonschema
Test Framework Guidelines
- DO NOT use
testifyfor writing tests - DO use
google/go-cmpfor comparing expected and actual values
File Naming Conventions
- Internal test files: append
_internal_test.gofor internal testing
Error Handling
Use slog and slog-error.