Code-Memo

Testing in CI

Unit tests

go test ./...

Race tests

go test -race ./...

Race tests are slower and mostly supported on linux/amd64 in typical CI setups.

Coverage

go test -cover ./...
go test -coverprofile=cover.out ./...
go tool cover -func=cover.out

Integration tests

Use one of:

Example -short pattern:

if testing.Short() {
	t.Skip("skipping integration tests")
}

Golden tests

Good for CLI output stability:

Flake control