1.0 KiB
1.0 KiB
Nerd Monitor - Agent Guidelines
Build & Test Commands
- Generate templates:
make templ - Build:
make build(server + agent) ormake build-server/make build-agent - Cross-platform:
make build-all - Clean:
make clean - Test all:
go test ./... - Test single:
go test -run TestName ./package - Format:
gofmt -w ./cmd ./internal ./views
Note: Go 1.23+ project using Templ templating. Run make templ before building.
Code Style Guidelines
- Imports: stdlib → third-party → internal (alphabetical within groups)
- Formatting:
gofmtstandards, explicit exported struct comments - Naming: CamelCase exports, lowercase unexported, single-letter receivers (e.g.,
(h *Handler)) - Error Handling: Explicit checks,
http.Error()for HTTP, contextual wrapping - Concurrency:
sync.RWMutexfor shared state, defer lock releases, small critical sections - HTTP: Chi router,
func (h *Handler) Method(w http.ResponseWriter, r *http.Request), set Content-Type, validate early