Repository navigation
v0.1.0 — initial env decoder
[0.1.0] - 2026-04-24
Initial release. Extracted from produktor.io/ai-fabric/pkg/env per
inventar/docs/asr/ASR-0008-ai-fabric-audit.md.
Added
Unmarshal(dst, opts...)— decode all process env vars into a Go struct.UnmarshalPrefix(dst, prefix, opts...)— prefix-scoped variant that
strips the prefix before building the path.AsMap()/AsMapPrefix(prefix)— escape hatch returning the nested
map[string]anybuilt fromos.Environ().- Options:
WithTrim,WithWeaklyTyped,WithTagName,WithDecodeHook. - TrimSpace on string values is enabled by default; disable with
WithTrim(false). - Error wrapping with
%won both decoder configuration and decode
failures — matchesmarkets-platform/TP-general-code/pkg/system
behaviour, improves on the original ai-fabric version.
Tests
- 15 pure-Go unit tests. No mocks.
asMapFromEnvironis tested with
syntheticenvironslices (not a mock — a pure input). Follows the
eSlidergo-*no-synthetic-mocks policy.