The Go language comes with a built-in template language, but not very many template functions. Sprig is a library that provides more than 100 commonly used template functions. It is inspired by the template functions found in Twig and in various JavaScript libraries, such as underscore.js. Sprig leverages mergo to handle merges. In its v0.3.9 release, there was a behavior change that impacts merging template functions in sprig. It is currently recommended to use v0.3.10 or later of that package. Using v0.3.9 will cause sprig tests to fail. v3 is currently stable release series on the master branch. The Go API should remain compatible with v2, the current stable version. Behavior change behind some functions is the reason for the new major version. By convention, all functions are lowercase. This seems to follow the Go idiom for template functions (as opposed to template methods, which are TitleCase).

Features

  • Sprig leverages mergo to handle merges
  • Sprig is a library that provides more than 100 commonly used template functions
  • It is inspired by the template functions found in Twig and in various JavaScript libraries, such as underscore.js
  • There are two active major versions of the sprig package
  • Please use Sprig's function documentation for detailed instructions
  • Call the functions inside of templates

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow Sprig

Sprig Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Sprig!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-13