- Module path: dappco.re/go/agent - Core import: dappco.re/go/core v0.4.7 - Process service re-enabled with new Core API - Plugin bumped to v0.11.0 - Directory flattened from go/ to root Co-Authored-By: Virgil <virgil@lethean.io>
817 B
817 B
Core Conventions Checklist
Error Handling
coreerr.E("pkg.Method", "msg", err)— always 3 args- Never
fmt.Errorforerrors.New - Import as
coreerr "forge.lthn.ai/core/go-log"
File I/O
coreio.Local.Read/Write/EnsureDir— neveros.ReadFile/WriteFileWriteMode(path, content, 0600)for sensitive files (keys, hashes)- Import as
coreio "forge.lthn.ai/core/go-io"
Safety
- Check
err != nilBEFOREresp.StatusCode - Type assertions use comma-ok:
v, ok := x.(Type) - No hardcoded paths (
/Users/,/home/,host-uk) - No tokens/secrets in error messages or logs
Style
- UK English in comments (colour, organisation, initialise)
- SPDX-License-Identifier: EUPL-1.2 on every file
- Test naming:
_Good,_Bad,_Ugly