Skip to content

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 18:20
Immutable release. Only release title and notes can be modified.
54d7ef4

CONGA v0.10.0 simplifies typed map binding—eliminating App.RegisterMap—and tightens startup validation across map types, config environment variables, boolean struct tags, and conga-lint diagnostics.

🚀 Highlights

  • Zero-registration typed maps: Typed maps now bind automatically without App.RegisterMap and parse keys and values through registered TypeParsers, including maps keyed or valued by named string types. Slice- and map-kind types with their own text unmarshaler, such as net.IP, bind as one value, and a missing parser fails at startup (#210, #215).
  • Safer config-variable reservation: Apps reserve <PREFIX>_CONFIG only when they register a config decoder or declare a ConfigFile field, and both runtime schema build and conga-lint catch flags or features bound to that variable at startup (#214, #216).
  • Strict boolean tags & unified schema diagnostics: hidden, negatable, and bootstrap reject misspelled tag values at startup (#212), and conga-lint shares exact schema error formatting with the runtime (#211).

⚠ Breaking Changes & Migration

API changes

  • App.RegisterMap removed; RegisterType rejects slices and maps (#210, closes #121, #113):
    • Delete app.RegisterMap(...) calls—typed maps now bind automatically.
    • Move any predictor previously passed to RegisterMap onto a predictor:"<name>" struct tag paired with app.Predictor("<name>", p), or implement a Predict method on a named map type.
    • App.RegisterType now panics for slice and map types; register a TypeParser for the element or value type instead.

Schema & startup guards

  • Config environment variable collisions (#214, closes #168):
    • In apps that read a config variable (via a registered decoder or a ConfigFile field), any flag or feature bound to that variable (such as a Config flag under EnvPrefix) now fails at startup with ErrSchema. Give it an explicit env:"..." tag or opt out with env:"-".
  • Unparseable field types fail at startup (#210):
    • Any flag or positional argument whose type, slice element, or map key/value has no parser now fails schema build with ErrSchema instead of failing later when a user supplies a value.
  • Strict boolean struct tags (#212, closes #165):
    • hidden, negatable, and bootstrap values other than empty, "true", or "false" (such as "yes", "1", or "True") now fail at startup with ErrSchema. Use the bare tag, "true", or "false".

Configuration

  • Config environment variable only for config-capable apps (#214, closes #168):
    • Apps without a decoder or ConfigFile field no longer read <PREFIX>_CONFIG, and env:"-" on ConfigFile now disables its environment variable.

Errors & diagnostics

  • Unified schema and conga-lint error wording (#211, closes #126):
    • Shadowing errors end in "on an ancestor command" without the command name.
    • Missing-Runner errors read: struct <Name>: schema error: runner not implemented: implement conga.Runner: Run(context.Context, *conga.Session) error.
    • Duplicate ConfigFile errors read: duplicate ConfigFile field (already declared by field <First>).
    • Update callers or tests that assert the previous message text.

🐛 Bug Fixes

  • maps: Bind maps keyed or valued by named string types without panicking in reflect.Value.Convert (#215).
  • lint: Report flags, features, and Features map variables bound to the reserved config-file environment variable, matching runtime schema build (#216).

📚 Documentation

  • struct-tags: Clarify that the len tag measures rune count on strings and applies per element on slices, while maps use items and reject len at schema build (#213, refs #166).

Full Changelog: v0.9.0...v0.10.0

Requirements: Go 1.27+ · Docs · pkg.go.dev