- Module github.com/eslider/go-config with env/yaml/json/ini packages - internal: source, keymap, merge, structconv, bytesutil - cmd/envc: convert, get, merge - docs/asr ASR-0001..0008, README/CHANGELOG/AGENTS refresh - golangci-lint v2 config; tests + fixtures Co-authored-by: Cursor <cursoragent@cursor.com>
875 B
875 B
ASR-0003: Uniform codec API and Source abstraction
Context
Users switch between YAML, JSON, INI, and env-file formats; a different function surface per format would increase cognitive load and test matrices.
Decision
- Every format package exports
New(opts...) *CodecwithMap,Unmarshal,UnmarshalContext,Marshal,WriteTo. - Bytes, readers, files, and URLs are modeled by
internal/source.SourcewithOpen(ctx) (io.ReadCloser, error). - HTTP(S) sources support
WithHTTPHeaderandWithHTTPClient.
Consequences
- Cross-format examples in the README stay structurally identical.
- URL behaviour is testable with
httptestagainst our client only.
Status
Accepted — 2026-05-02.
References
- ASR-0005 — merge semantics across multiple sources
- ASR-0008 — httptest policy alignment