Instruction file imported from EngFlow/gazelle_cc (
.cursor/rules/style.mdc). Copyright stays with the author.
description: Code style and structure guidelines for this project globs: **/*.go
Code style guidelines
Directory structure
- Logic specific to
language.Languageinterface is put under thelanguage/cc/directory. - Utilities still related to
language.Languageinterface but big enough to deserve their own Go packages are put under thelanguage/internal/cc/directory. - Generic utilities unrelated to
language.Languageinterface are put under theinternal/directory.
Code style for Go files
- Always include a copyright header at the beginning of the file.
- Wrap comments at the column 80.
- Prefer using
internal/collections/set.goto rawmap[T]boolormap[T]struct{}. - Prefer using sequential operations from
internal/collections/collections.gounless the outcome code structure is too complicated. - Always name symbols beginning with a lowercase letter unless they need to be exported to another package.
- Attach docs to a function when its name and arguments don't clearly indicate its purpose. You don't have to describe arguments and a return value if their meaning can be deduced from names and types.