Useful template functions for Go templates.
IMPORTANT: This release reverts a change from 2.18.0
In the previous release (2.18), we prematurely merged a partial change to the crypto functions that led to creating two sets of crypto functions (I blame @technosophos -- since that's me). This release rolls back that change, and does what was originally intended: It alters the existing crypto functions to use secure random.
We debated whether this classifies as a change worthy of major revision, but given the proximity to the last release, we have decided that treating 2.18 as a faulty release is the correct course of action. We apologize for any inconvenience.
Sprig has been updated to accommodate a breaking change to Go Templates' nil handling that was introduced in Go 1.11. Along the way, we added some new functions and updated the documentation in several places.
A few new functions were added, including:
The 2.17.0 release did not have a version pinned for xstrings
, which caused compilation failures when xstrings < 1.2 was used. This adds the correct version string to glide.yaml.
This release adds a few functions and fixes a handful of bugs.
values
function df393122472a0abccc1046e2cf05173b14a00535 (Lawrence Jones)Two important notes:
Round
function on duration introduced in 1.9.ago
function. Note, the removes support for Go 1.8 and olderThis new version of Sprig adds a set of functions for generating and working with SSL certificates.
genCA
generates an SSL Certificate AuthoritygenSelfSignedCert
generates an SSL self-signed certificategenSignedCert
generates an SSL certificate and key based on a given CAThis release adds new functions, including:
regexMatch
, regexFindAll
, regexFind
, regexReplaceAll
, regexReplaceAllLiteral
, and regexSplit
to work with regular expressionsfloor
, ceil
, and round
math functionstoDate
converts a string to a datenindent
is just like indent
but also prepends a new lineago
returns the time from time.Now