dygo Go Development
Write direct Go that makes framework boundaries easy to see.
Rules
- Follow the Go version and dependencies in
go.mod. - Keep
cmd/entry points small. Put framework implementation in focusedinternal/packages. - Keep the public App contract in
pkg/dygoand avoid leaking internal types. - Accept
context.Contextfor blocking, database, request, and background operations. - Wrap errors with a short operation description and
%wwhen callers need the cause. - Keep interfaces small and define them near the consumer when practical.
- Prefer explicit data flow and typed boundaries over reflection, global state, and generic maps.
- Preserve transaction ownership. Do not start hidden nested transactions.
- Bound goroutines and make cancellation and ownership clear.
- Use existing registries and shared contracts before you create a parallel mechanism.
- Add exported documentation where the API needs a stable contract.
Check
Run gofmt on changed Go files. Use focused package tests first. Use vet, race checks, or the full suite when concurrency, public APIs, database state, release code, or a major final change justifies the cost.