code-style ยท diff
git:20261013.838a5e0 to git:20261013.10eb20e
1 added, 1 removed. Audit A to A.
---
description: Formatting, lint, comments language
globs: **/*.go
alwaysApply: false
---
# Code style (Go)
1. **`gofmt`** / **`go fmt`** - format before committing when you touch files.
- 2. **`make lint`** - the repo gate (see **`Makefile`**): **`make fmt-check`** (`gofmt -s -l` over every Go file git tracks, whatever its build tags or platform), `golangci-lint` over the untagged tree, over every tag but `ui` and over the shipped tag set, then `tsc --noEmit` over the SPA sources (`make ui-typecheck`). **`.golangci.yml`** enables the `gofmt` formatter (`gofmt -s`) beside the default linters, so an unformatted file fails the gate; `gofmt -s -w <file>` or `golangci-lint fmt` fixes it.
+ 2. **`make lint`** - the repo gate (see **`Makefile`**): **`make fmt-check`** (`gofmt -s -l` over every Go file git tracks, whatever its build tags or platform), `golangci-lint` over the untagged tree, over every tag but `ui` and over the shipped tag set, then `tsc --noEmit` over the SPA sources (`make ui-typecheck`). **`.golangci.yml`** enables the `gofmt` formatter (`gofmt -s`) beside the five linters it names (golangci-lint's `standard` set), so an unformatted file fails the gate; `gofmt -s -w <file>` or `golangci-lint fmt` fixes it.
3. Comments in code - **English only**.
4. Follow existing patterns in neighboring files (imports grouping, naming, error handling).
## References
@Makefile