gofmt / goimports on save.i, r, b), longer names for globals and function parameters.GetX; use X() for field x when appropriate (see standard library).error from fallible functions; wrap with fmt.Errorf("context: %w", err).errors.Is; extract types with errors.As.Design structs so the zero value is usable or obviously invalid — reduces constructor boilerplate when safe.
Handle errors in the happy path down the left margin; reduce deep nesting with early returns.
if err != nil {
return err
}
// happy path continues
A plain for loop is often clearer than a generic chain. Prefer standard library patterns over frameworks for small services.
Document exported symbols; start comments with the name (// User represents ...). Run go doc locally.
Do not hide goroutine lifetimes; tie long work to context.Context.
Table-driven tests, subtests with t.Run, examples that run as tests when they contain // Output:.