sprig

Useful template functions for Go templates.

MIT License

Stars
4.3K
Committers
96
sprig - v3.3.0 Latest Release

Published by mattfarina about 2 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/Masterminds/sprig/compare/v3.2.3...v3.3.0

sprig - v3.2.3

Published by mattfarina almost 2 years ago

Changed

  • Updated docs (thanks @book987 @aJetHorn @neelayu @pellizzetti @apricote @SaigyoujiYuyuko233 @AlekSi)
  • #348: Updated huandu/xstrings which fixed a snake case bug (thanks @yxxhero)
  • #353: Updated masterminds/semver which included bug fixes
  • #354: Updated golang.org/x/crypto which included bug fixes
sprig - Re-release of v3.2.1

Published by technosophos over 3 years ago

This release is here simply to satisfy the Go module system. The code is precisely the same as v3.2.1.

sprig - Update to latest goutils

Published by technosophos over 3 years ago

This is a security release for Masterminds/goutils v1.1.1. See the Security Advisory.

Changelog

Release 3.2.1 (2021-02-04)

Changed

sprig - v3.2.0

Published by mattfarina almost 4 years ago

Added

  • #211: Added randInt function (thanks @kochurovro)
  • #223: Added fromJson and mustFromJson functions (thanks @mholt)
  • #242: Added a bcrypt function (thanks @robbiet480)
  • #253: Added randBytes function (thanks @MikaelSmith)
  • #254: Added dig function for dicts (thanks @nyarly)
  • #257: Added regexQuoteMeta for quoting regex metadata (thanks @rheaton)
  • #261: Added filepath functions osBase, osDir, osExt, osClean, osIsAbs (thanks @zugl)
  • #268: Added and and all functions for testing conditions (thanks @phuslu)
  • #181: Added float64 arithmetic addf, add1f, subf, divf, mulf, maxf, and minf
    (thanks @andrewmostello)
  • #265: Added chunk function to split array into smaller arrays (thanks @karelbilek)
  • #270: Extend certificate functions to handle non-RSA keys + add support for
    ed25519 keys (thanks @misberner)

Changed

  • Removed testing and support for Go 1.12. ed25519 support requires Go 1.13 or newer
  • Using semver 3.1.1 and mergo 0.3.11

Fixed

  • #249: Fix htmlDateInZone example (thanks @spawnia)

NOTE: The dependency github.com/imdario/mergo reverted the breaking change in
0.3.9 via 0.3.10 release.

sprig - v3.1.0

Published by mattfarina over 4 years ago

NOTE: The dependency github.com/imdario/mergo made a behavior change in 0.3.9
that impacts sprig functionality. Do not use sprig with a version newer than 0.3.8.

Added

  • #225: Added support for generating htpasswd hash (thanks @rustycl0ck)
  • #224: Added duration filter (thanks @frebib)
  • #205: Added seq function (thanks @thadc23)

Changed

  • #203: Unlambda functions with correct signature (thanks @muesli)
  • #236: Updated the license formatting for GitHub display purposes
  • #238: Updated package dependency versions. Note, mergo not updated to 0.3.9
    as it causes a breaking change for sprig. That issue is tracked at
    https://github.com/imdario/mergo/issues/139

Fixed

  • #229: Fix seq example in docs (thanks @kalmant)
sprig - v3.0.2

Published by mattfarina almost 5 years ago

Fixed

  • #220: Updating to semver v3.0.3 to fix issue with <= ranges
  • #218: fix typo elyptical->elliptic in ecdsa key description (thanks @laverya)
sprig - v3.0.1

Published by mattfarina almost 5 years ago

Fixed

  • #212: Updated semver fixing broken constraint checking with ^0.0
sprig - Release 3.0.0

Published by mattfarina about 5 years ago

Sprig v3 brings some changes while retaining the same Go API. This should enable projects to migrate to v3 with relative ease.

You might be wondering, why increment the major version if the Go API didn't break? The reason for that is some edge case behavior changed. Most importantly the use of ^ while handling major version 0 use cases with semver. To be cautious, the major version of sprig was incremented to limit the number of surprises.

Added

  • #187: Added durationRound function (thanks @yjp20)
  • #189: Added numerous template functions that return errors rather than panic (thanks @nrvnrvn)
  • #193: Added toRawJson support (thanks @Dean-Coakley)
  • #197: Added get support to dicts (thanks @Dean-Coakley)

Changed

  • #186: Moving dependency management to Go modules
  • #186: Updated semver to v3. This has changes in the way ^ is handled
  • #194: Updated documentation on merging and how it copies. Added example using deepCopy
  • #196: trunc now supports negative values (thanks @Dean-Coakley)
sprig - 2.22.0

Published by mattfarina about 5 years ago

Added

  • #173: Added getHostByName function to resolve dns names to ips (thanks @fcgravalos)
  • #195: Added deepCopy function for use with dicts

Changed

  • Updated merge and mergeOverwrite documentation to explain copying and how to
    use deepCopy with it
sprig - v2.21.0

Published by mattfarina about 5 years ago

Added

  • #122: Added encryptAES/decryptAES functions (thanks @n0madic)
  • #128: Added toDecimal support (thanks @Dean-Coakley)
  • #169: Added list contcat (thanks @astorath)
  • #174: Added deepEqual function (thanks @bonifaido)
  • #170: Added url parse and join functions (thanks @astorath)

Changed

  • #171: Updated glide config for Google UUID to v1 and to add ranges to semver and testify

Fixed

  • #172: Fix semver wildcard example (thanks @piepmatz)
  • #175: Fix dateInZone doc example (thanks @s3than)
sprig - Release 2.20.0

Published by mattfarina over 5 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)
sprig - 2.19.0: Fixes, reversion of 2.18 change

Published by technosophos over 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)
sprig - New functions, updates for Go 1.11, and improved documentation

Published by technosophos over 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)
sprig - Bug fix: Update dependencies

Published by technosophos almost 6 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.

sprig - Minor release: New functions, updated dependencies

Published by technosophos almost 6 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)
sprig - Minor release: New functions, bugfixes

Published by technosophos about 6 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)
sprig - Release 2.15.0

Published by mattfarina over 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
sprig - Release 2.14.1

Published by mattfarina almost 7 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
sprig - 2.14 adds SSL certificate generation

Published by technosophos about 7 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