This document outlines the key differences and migration changes between the Sprig and Sprout libraries. The changes are designed to enhance stability and usability in the Sprout library.
This document will help contributors and maintainers understand the changes made between the fork date and version 1.0.0 of the Sprout library.
It will be updated to reflect changes in future versions of the library.
This document will also assist in creating the migration guide when version 1.0 is ready.
Any changes between the fork date and version 1.0.0 of the Sprout library not migrated yet to the Migration from Sprig will be documented here.
In Sprig, some functions have bugs that have been fixed in Sprout:
{{ "foooboooooo" | abbrevboth 4 9 }}
- Sprig:
fooobo...
- Sprout:
...boo...
{{ "FoO bar" | camelcase }}
|{{ "foo bar" | camelcase }}
- Sprig:
FoO Bar
|Foo Bar
- Sprout:
FoOBar
|FooBar
{{ camelcase "___complex__case_" }}
|{{ camelcase "_camel_case" }}
- Sprig:
___Complex_Case_
|_CamelCase
- Sprout:
ComplexCase
|CamelCase
{{ "foo bar" | kebabcase }}
- Sprig:
foo--bar
- Sprout:
foo-bar
{{ "foo bar" | snakecase }}
- Sprig:
foo__bar
- Sprout:
foo_bar
{{ snakecase "Duration2m3s" }}
|{{ snakecase "Bld4Floor3rd" }}
- Sprig:
duration_2m3s
|bld4_floor_3rd
- Sprout:
duration_2m_3s
|bld_4floor_3rd
{{ "foobar" | substr 0 -3 }}
|{{ "foobar" | substr -3 6 }}
- Sprig:
foobar
|foobar
- Sprout:
foo
|bar
{{ .duration | durationRound }}
- Sprig:
0s
(only when not cast totime.Duration
before,{{ .duration | duration | durationRound }}
works as expected with5s
) - Sprout:
5s