- Updated AGENTS.md and README.md to clarify the automated release process using release-please and GoReleaser. - Added a version command to the envc CLI to display build metadata. - Included CI/CD details in README for better understanding of testing and release automation.
2.2 KiB
2.2 KiB
AGENTS.md — go-config
This module is part of the eSlider go-* library standard (inventar ASR-0008).
Purpose
Convert env, YAML, JSON, and INI into nested map[string]any and Go structs (and back), with multi-source merging and the envc CLI.
Public API surface
- Subpackages:
env,yaml,json,ini— each exportsNew,(*Codec).Map,Unmarshal,UnmarshalContext,Marshal,WriteTo, and format-specific options. cmd/envc— binaryenvc:convert,get,merge.- Internals under
internal/are not stable API.
Breaking changes require a new major SemVer tag (or /v2 module path if the policy changes).
Testing policy
Follows the eSlider "no synthetic mocks" policy (see .cursor/rules/no-synthetic-mocks.mdc):
- Unit tests — pure inputs for merge, keymap, structconv, env flat-map helpers.
httptest— allowed only to test our HTTP client behaviour ininternal/source(not third-party API emulation).- Fixtures — real files under
fixtures/;testfixturesresolves paths from module root.
Decisions
Architecture Significant Requirements: docs/asr/README.md.
Checklist before release
Local sanity check (CI runs the same on every PR):
go mod tidy
go vet ./...
go test -race -shuffle=on -count=1 ./...
golangci-lint run --timeout 5m
Versioning is automated via release-please and GoReleaser — do not hand-edit version strings or tag manually:
- Commit using Conventional Commits
(
feat:,fix:,feat!:for breaking, etc.). .github/workflows/release-please.ymlopens a release PR on each push tomainwith the computed next SemVer and an updatedCHANGELOG.md.- Merging that PR creates the
vX.Y.Ztag..github/workflows/release.ymlthen runs GoReleaser to publish cross-platformenvcbinaries and a GitHub Release.
Related
inventar/docs/asr/ASR-0008.md— Go library module conventionsgo-onlyoffice/AGENTS.md— reference for the eSlider library template