# hoardCTI Go Style Guide
> The style and environment guide for every hoardCTI repository written in Go: 441 rules, each with a stable ID (GO--), a MUST/SHOULD/MAY level, reasoning and examples. Several house rules deliberately differ from common Go style.
AI agents: read the skill first. It explains how to access the guide, find a rule by ID, and apply the guide when writing or reviewing code. Every page on this site is available as raw Markdown by using the `.md` path, as in the links below.
## Start here
- [SKILL.md](https://style.hoardcti.com/v1/golang/SKILL.md): agent skill describing how to use this guide. Read this first.
- [Contents](https://style.hoardcti.com/v1/golang/README.md): every page, grouped by part
- [House rules](https://style.hoardcti.com/v1/golang/foundations/house-rules.md): the six hoardCTI rules that differ from common Go
- [Rule index](https://style.hoardcti.com/v1/golang/appendices/rule-index.md): every rule ID with its level and title
- [Review checklist](https://style.hoardcti.com/v1/golang/appendices/review-checklist.md): every MUST and MUST NOT rule
## Foundations
- [Principles](https://style.hoardcti.com/v1/golang/foundations/principles.md): audience, rule format, IDs, precedence (GO-GEN)
## Environment
- [Toolchain](https://style.hoardcti.com/v1/golang/environment/toolchain.md) (GO-ENV)
- [Modules and dependencies](https://style.hoardcti.com/v1/golang/environment/modules-and-dependencies.md) (GO-MOD)
- [Editor setup](https://style.hoardcti.com/v1/golang/environment/editor-setup.md) (GO-EDT)
- [Makefile](https://style.hoardcti.com/v1/golang/environment/makefile.md) (GO-MAK)
- [Continuous integration](https://style.hoardcti.com/v1/golang/environment/continuous-integration.md) (GO-CI)
- [Configuration](https://style.hoardcti.com/v1/golang/environment/configuration.md) (GO-CFG)
- [Building](https://style.hoardcti.com/v1/golang/environment/building.md) (GO-BLD)
## Structure
- [Repository layout](https://style.hoardcti.com/v1/golang/structure/repository-layout.md) (GO-LAY)
- [Packages and files](https://style.hoardcti.com/v1/golang/structure/packages-and-files.md) (GO-PKG)
- [Main packages](https://style.hoardcti.com/v1/golang/structure/main-packages.md) (GO-MAIN)
- [Build tags, generate and embed](https://style.hoardcti.com/v1/golang/structure/build-tags-generate-embed.md) (GO-BTG)
## Formatting and naming
- [Formatting](https://style.hoardcti.com/v1/golang/formatting/formatting.md) (GO-FMT)
- [Imports](https://style.hoardcti.com/v1/golang/formatting/imports.md) (GO-IMP)
- [Identifiers](https://style.hoardcti.com/v1/golang/naming/identifiers.md) (GO-NAM)
- [External names](https://style.hoardcti.com/v1/golang/naming/external-names.md) (GO-EXT)
## Documentation
- [Comments](https://style.hoardcti.com/v1/golang/documentation/comments.md) (GO-DOC)
- [Explaining Go](https://style.hoardcti.com/v1/golang/documentation/explaining-go.md) (GO-EXP)
## Language
- [Control flow](https://style.hoardcti.com/v1/golang/language/control-flow.md) (GO-CTL)
- [Declarations](https://style.hoardcti.com/v1/golang/language/declarations.md) (GO-DEC)
- [Data types](https://style.hoardcti.com/v1/golang/language/data-types.md) (GO-TYP)
- [Functions and methods](https://style.hoardcti.com/v1/golang/language/functions-and-methods.md) (GO-FUN)
- [Interfaces](https://style.hoardcti.com/v1/golang/language/interfaces.md) (GO-IFC)
- [Generics and iterators](https://style.hoardcti.com/v1/golang/language/generics-and-iterators.md) (GO-GNR)
- [defer, panic and recover](https://style.hoardcti.com/v1/golang/language/defer-panic-recover.md) (GO-DPR)
- [Restricted features](https://style.hoardcti.com/v1/golang/language/restricted-features.md) (GO-RST)
- [Modern Go](https://style.hoardcti.com/v1/golang/language/modern-go.md) (GO-MDN)
## Errors and concurrency
- [Errors](https://style.hoardcti.com/v1/golang/errors/errors.md) (GO-ERR)
- [Goroutines](https://style.hoardcti.com/v1/golang/concurrency/goroutines.md) (GO-GOR)
- [Channels](https://style.hoardcti.com/v1/golang/concurrency/channels.md) (GO-CHN)
- [sync and atomics](https://style.hoardcti.com/v1/golang/concurrency/sync-and-atomics.md) (GO-SYN)
- [context](https://style.hoardcti.com/v1/golang/concurrency/context.md) (GO-CTX)
- [Concurrency patterns](https://style.hoardcti.com/v1/golang/concurrency/patterns.md) (GO-PAT)
## Standard library
- [Logging](https://style.hoardcti.com/v1/golang/standard-library/logging.md) (GO-LOG)
- [HTTP](https://style.hoardcti.com/v1/golang/standard-library/http.md) (GO-HTP)
- [JSON](https://style.hoardcti.com/v1/golang/standard-library/json.md) (GO-JSN)
- [Time](https://style.hoardcti.com/v1/golang/standard-library/time.md) (GO-TIM)
- [Files and paths](https://style.hoardcti.com/v1/golang/standard-library/files-and-paths.md) (GO-FIL)
- [Command line](https://style.hoardcti.com/v1/golang/standard-library/command-line.md) (GO-CLI)
- [Other standard library packages](https://style.hoardcti.com/v1/golang/standard-library/other-packages.md) (GO-LIB)
## Testing
- [Coverage](https://style.hoardcti.com/v1/golang/testing/coverage.md) (GO-COV)
- [Writing tests](https://style.hoardcti.com/v1/golang/testing/writing-tests.md) (GO-TST)
- [Test doubles and fixtures](https://style.hoardcti.com/v1/golang/testing/test-doubles-and-fixtures.md) (GO-TDF)
- [Specialised tests](https://style.hoardcti.com/v1/golang/testing/specialised-tests.md) (GO-SPT)
## Security, API design and performance
- [Security](https://style.hoardcti.com/v1/golang/security/security.md) (GO-SEC)
- [API design](https://style.hoardcti.com/v1/golang/api-design/api-design.md) (GO-API)
- [Performance](https://style.hoardcti.com/v1/golang/performance/performance.md) (GO-PRF)
## Optional
- [Glossary](https://style.hoardcti.com/v1/golang/appendices/glossary.md): Go terms for readers new to Go
- [AI assistants](https://style.hoardcti.com/v1/golang/appendices/ai-assistants.md): keeping AI-written code on style
- [Ready-to-copy configuration](https://style.hoardcti.com/v1/golang/appendices/configs/README.md): .golangci.yml, Makefile, AGENTS.md and more
- [Changelog](https://style.hoardcti.com/v1/golang/CHANGELOG.md)
- [Contributing](https://style.hoardcti.com/v1/golang/CONTRIBUTING.md)