Sprig Versions Save

Useful template functions for Go templates.

v2.20.0

4 years ago

Added

  • #164: Adding function to get unix epoch for a time (@mattfarina)
  • #166: Adding tests for date_in_zone (@mattfarina)

Changed

  • #144: Fix function comments based on best practices from Effective Go (@CodeLingoTeam)
  • #150: Handles pointer type for time.Time in "htmlDate" (@mapreal19)
  • #161, #157, #160, #153, #158, #156, #155, #159, #152 documentation updates (@badeadan)

2.19.0

5 years ago

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.

Changes

  • Fix substr panic 35fb796e3ed3869e2df7be0e4fcb5e8b2c425453 (Alexey igrychev)
  • Remove extra period 1eb7729022202c016475c4f4d0cb2c463c22c5fe (Matthew Lorimor)
  • Make random string functions use crypto by default 6ceff26ca2586bda18e788afef093b7d89e70023 (Matthew Lorimor)
  • README edits/fixes/suggestions 08fe136717db5c06a7dd9ee140f9de7070774c78 (Lauri Apple)

v2.18.0

5 years ago

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:

  • mergeOverwrite
  • cryptographic functions that use secure random (see fe1de1249f2781f5873969508aa1c9a297671ce0)

All Changes

  • Improve documentation of regexMatch function, resolves #139 90b89cedc86ac45049f89567139100466aa66b4d (Jan Tagscherer)
  • Handle has for nil list 9c108854bc36c8c5a4bc12af6efef00b2093cf81 (Daniel Cohen)
  • Document behaviour of mergeOverwrite fe0dbe93e8c69514fd7e1520237f617219936dd6 (Lukas Rieder)
  • Fix dict merge issue and provide mergeOverwrite .dst .src1 to overwrite from src -> dst 4c59c1250a68e7f7a7e48c54f68c38b5c4c26d20 (Lukas Rieder)
  • doc: adds missing documentation. 4b871e6ee25372506d32433b8500c329feaae404 (Fernandez Ludovic)
  • Replace outdated goutils imports 01893d2f350f3b349e29fd3c5cd49d575293ea04 (Matthew Lorimor)
  • Surface crypto secure random strings from goutils fe1de1249f2781f5873969508aa1c9a297671ce0 (Matthew Lorimor)
  • Handle untyped nil values as paramters to string functions 2b2ec8fad08275e41bc78b9d4ad4938f430e3ef8 (Morten Torkildsen)
  • Fix substr var names and comments d581f80788b5e3493eed4639a3b9b86adf564884 (Dean Coakley)
  • Fix substr documentation 27372034d6d4bc190df568170ea616c97cc4b505 (Dean Coakley)

v2.17.1

5 years ago

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.

v2.17.0

5 years ago
  • Update goutils to 1.1.0 4e1125d1400cd9d0d05045013dda46b391f82461 (Matt Butcher)
  • fixes spelling errors... not sure how that happened 4cf188a2b79bcba173ac96e90912cdebcabae153 (marshallford)
  • adds alder32sum function and test 6908fc2d99d9e77185fe248522903e54f8e5ea25 (marshallford)
  • Added kebabcase function ca331a1b276654fa7e74f0b823c1dc57be128a66 (Ilyes512)
  • Fix 'has' documentation e3f2a8519b45e095bdd02b0859346a19942423c9 (dean-coakley)
  • docs(dict): fix typo in pick example dc424f950a9a3fcad8c5175ad9dccb310480b717 (Dustin Specker)

v2.16.0

5 years ago

This release adds a few functions and fixes a handful of bugs.

  • Test on go 1.11 49df8097cae92e03cc4e7a167547097d326561ca (Helgi Þormar Þorbjörnsson)
  • Remove duplicated documentation 1d97af137fe1aa7f9e7f46f8d7992b49f96c72fa (Matthew Fisher)
  • add splitn function fccb0b0b31da4884761b9d09598a7e912bd77273 (Helgi Þorbjörnsson)
  • Extract values of dict with values function df393122472a0abccc1046e2cf05173b14a00535 (Lawrence Jones)
  • Minor improvement in code quality - Removed an unreachable piece of code at defaults.go#L26:6 - Resolve formatting issues. 58342415b5b59750f35007a5ac85686478835ac9 (Abhishek Kashyap)
  • Modify panic message for list.slice ae38335fd3a55498f017cfbced1a784221f2ef66 (gongdo)
  • Fix file permissions c5f40b56d466470d82620c466ee189af366e4d44 (gongdo)
  • Fix example for buildCustomCert 7779e0d58432c0df5cf19053fa49a43047c7c4e2 (Tin Lam)
  • Add slice func df28ca70c236b53702a38e6ee30cd24b78e76548 (gongdo)
  • Generate serial number a3bdffd00c74fa4f5e082de7596a7801b273a2bc (Cody Coons)

v2.15.0

6 years ago

Two important notes:

  1. This release drops support for Go prior to 1.9. Only supported versions of Go, by the Go Team, are supported by this release. This is due to the use of the Round function on duration introduced in 1.9.
  2. The uuid handling switched to google/uuid due to issues with consuming apps fetching from the tip of master of dependencies. satori/go.uuid has changed it's signature in unreleased code.

Added

  • #68 and #69: Add json helpers to docs (thanks @arunvelsriram)
  • #66: Add ternary function (thanks @binoculars)
  • #67: Allow keys function to take multiple dicts (thanks @binoculars)
  • #89: Added sha1sum to crypto function (thanks @benkeil)
  • #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei)
  • #92: Add travis testing for go 1.10
  • #93: Adding appveyor config for windows testing

Changed

  • #90: Updating to more recent dependencies
  • #73: replace satori/go.uuid with google/uuid (thanks @petterw)

Fixed

  • #76: Fixed documentation typos (thanks @Thiht)
  • Fixed rounding issue on the ago function. Note, the removes support for Go 1.8 and older

v2.14.1

6 years ago

Fixed

  • #60: Fix typo in function name documentation (thanks @neil-ca-moore)
  • #61: Removing line with {{ due to blocking github pages genertion
  • #64: Update the list functions to handle int, string, and other slices for compatibility

v2.14.0

6 years ago

This new version of Sprig adds a set of functions for generating and working with SSL certificates.

  • genCA generates an SSL Certificate Authority
  • genSelfSignedCert generates an SSL self-signed certificate
  • genSignedCert generates an SSL certificate and key based on a given CA

v2.13.0

6 years ago

This release adds new functions, including:

  • regexMatch, regexFindAll, regexFind, regexReplaceAll, regexReplaceAllLiteral, and regexSplit to work with regular expressions
  • floor, ceil, and round math functions
  • toDate converts a string to a date
  • nindent is just like indent but also prepends a new line
  • ago returns the time from time.Now

Changelog

Added

  • #40: Added basic regex functionality (thanks @alanquillin)
  • #41: Added ceil floor and round functions (thanks @alanquillin)
  • #48: Added toDate function (thanks @andreynering)
  • #50: Added nindent function (thanks @binoculars)
  • #46: Added ago function (thanks @slayer)

Changed

  • #51: Updated godocs to include new string functions (thanks @curtisallen)
  • #49: Added ability to merge multiple dicts (thanks @binoculars)