The project follows DDD principles. DO NOT COMMENT EXECESSIVELY. Instead, write clear and concise code that is self-explanatory.
- DO NOT USE
sed
for file manipulation
- After changes to css or .templ files:
make generate && make css
- After changes to Go code:
go vet ./...
- Run all tests:
make test
orgo test -v ./...
- Run single test:
go test -v ./path/to/package -run TestName
- Run specific subtest:
go test -v ./path/to/package -run TestName/SubtestName
- Linting translation files:
make run-iota-linter
- Apply migrations:
make migrate up
- Use
go fmt
for formatting. Do not indent code manually. - Use Go v1.23.2 and follow standard Go idioms
- File organization: group related functionality in modules/ or pkg/ directories
- Naming: use camelCase for variables, PascalCase for exported functions/types
- Testing: table-driven tests with descriptive names (TestFunctionName_Scenario)
- Error handling: use pkg/serrors for standard error types
- Type safety: use strong typing and avoid interface{} where possible
- Follow existing patterns for database operations with jmoiron/sqlx
- For UI components, follow the existing templ/htmx patterns
- NEVER read *_templ.go files, they contain no useful information since they are generated by templ generate (make generate) command from .templ files
- Use
htmx.IsHxRequest(r)
to check if a request is from HTMX - Use
htmx.SetTrigger(w, "eventName", payload)
for setting HTMX response triggers