Repository navigation
feat(tmpl): add sprig template helpers - #19
Conversation
Bumps the minor-and-patch group with 1 update: [charm.land/lipgloss/v2](https://github.com/charmbracelet/lipgloss). Updates `charm.land/lipgloss/v2` from 2.0.5 to 2.0.6 - [Release notes](https://github.com/charmbracelet/lipgloss/releases) - [Commits](charmbracelet/lipgloss@v2.0.5...v2.0.6) --- updated-dependencies: - dependency-name: charm.land/lipgloss/v2 dependency-version: 2.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com>
kwent
left a comment
There was a problem hiding this comment.
Reviewed Sprig registration, preservation of strict get and value-first default semantics, and regression tests. Added documentation for helpers and missing-key fallbacks, and resolved the module conflict with the reviewed Lip Gloss update. Fresh CI is green on c2f1cdd (build, tests, vet, lint, govulncheck); the combined four-PR tree also passes go test -race ./.... Live API integration remains blocked by the shared test account trial expiration.
kwent
left a comment
There was a problem hiding this comment.
Re-reviewed the final master merge and module conflict resolution. The diff contains only Sprig integration, its regressions, and documentation; updated Lip Gloss dependencies are preserved. Fresh CI is green on 0dba6b3. The combined release tree also passed build, race tests, and vet.
Adds the Sprig (https://github.com/Masterminds/sprig) function library to the template engine, so field-mapping templates can use helpers like lower, upper, trim, replace, dig, etc.
Non-breaking
Layered as an overlay: start from sprig.TxtFuncMap(), then re-register the repo's get/default on top so their behavior is unchanged. This matters because Sprig's versions differ, default has reversed arg order, and get returns "" instead of erroring on a missing key, so overriding them keeps existing configs and doc examples working.
Tests
loweris available and works.go buildandgo test ./...all pass.