mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-27 11:17:29 +02:00
Collapse dev commands into Principles, reference golang-best-practices for Go style, and consolidate Testing (scoped tests, testify, ldflags).
31 lines
926 B
Markdown
31 lines
926 B
Markdown
# AGENTS.md
|
|
|
|
## Principles
|
|
|
|
DO NOT run build command.
|
|
|
|
## Documentation
|
|
|
|
Update package level `README.md` after making significant changes.
|
|
|
|
## Go Guidelines
|
|
|
|
1. Use `golang-best-practices` skill.
|
|
2. Use `internal/task/task.go` for lifetime management:
|
|
- `task.RootTask()` for background operations
|
|
- `parent.Subtask()` for nested tasks
|
|
- `OnFinished()` and `OnCancel()` callbacks for cleanup
|
|
3. Use `gperr "goutils/errs"` to build pretty nested errors:
|
|
- `gperr.Multiline()` for multiple operation attempts
|
|
- `gperr.NewBuilder()` to collect errors
|
|
- `gperr.NewGroup() + group.Go()` to collect errors of multiple concurrent operations
|
|
- `gperr.PrependSubject()` to prepend subject to errors
|
|
4. Use `github.com/puzpuzpuz/xsync/v4` for lock-free thread safe maps
|
|
5. Use `goutils/synk` to retrieve and put byte buffer
|
|
|
|
## Testing
|
|
|
|
- Prefer scoped tests
|
|
- Prefer `testify`
|
|
- Use `-ldflags="-checklinkname=0"`
|