v3.11.0
👋 Welcome to another gomplate release! Once more, a number of bug fixes and new
features. Thanks to the community, gomplate is now available via
MacPorts as well!
Thanks
Plenty of people have contributed to gomplate by filing issues, suggesting new
features, or submitting pull requests. I'd like to especially thank the
following people for submitting pull requests in this release:
Deprecations
I'm starting to work on gomplate v4, the next major release (with breaking
changes). In preparation for this, I'm listing some features as deprecated (see
the deprecation policy). Note that some of these may have been
deprecated for a while, but I'd like to call them out explicitly here.
- The BoltDB
datasource is now deprecated (see this discussion),
and will be removed in v4.0.0. - The
slim
binaries are deprecated, and will no longer be produced starting
with v4.0.0. - A number of functions are deprecated, though not all will be removed in v4:
strings.Sort
(usecoll.Sort
instead)conv.Dict
(usecoll.Dict
instead)conv.Slice
(usecoll.Slice
instead)conv.Has
(usecoll.Has
instead)conv.Bool
(useconv.ToBool
instead)
- The array form of configuring nested templates is deprecated, and a new map-
based form is now available. This will be removed in v4.
Be sure to also check out the multi-platform Docker images available at hairyhenderson/gomplate
.
If you've gained value out of gomplate and want to find a way to encourage development, please consider sponsoring gomplate!
v3.11.0 (2022-06-12)
Release Notes
New features and changes
- #1422 New experimental
gomplate.Renderer
API is available for rendering templates programmatically. This should be of interest for developers wishing to use gomplate as a library. See the Go docs for examples. - #1410 Nested templates can now be referenced by URL and not just by path.
- Notes:
- Currently, only the
file:
URL scheme is supported. The full set of datasource URL schemes will be supported in a future release. - This also introduces a new format for the
templates
config option, and deprecates the previous format. See the docs fortemplates
for more information.
- Currently, only the
- Notes:
- #1402 Support for AWS IMDSv2 (EC2 instance metadata) is now available - thanks to @surki for the contribution!
- #1358 Adding warning messages when using deprecated functions and datasources.
- #1335 Now built with Go 1.18, which adds two new functions:
break
, andcontinue
. - #1317 Plugins now support piping input arguments to the plugin's stdin, rather than a commandline argument. This can be configured in the config file (see the docs for details).
- #1307 Missing directories are now automatically created for output files
New functions
- #1388 Two new experimental functions for generating ECDSA keys:
crypto.ECDSAGenerateKey
crypto.ECDSADerivePublicKey
- These are experimental as the semantics may change in a future release
- #1364 Two new template functions to help identify which template is being rendered:
- #1342 Four new functions in the
net
namespace for working with networks in CIDR notation - thanks to @bartoszj for the contribution! - #1306 Hashing functions that return raw bytes (like
crypto.SHA*
, but returns raw bytes instead of strings) - #1305 Two new functions to encrypt and decrypt with AES:
crypto.EncryptAES
crypto.DecryptAES
- These are experimental as the semantics may change in a future release
- #1287 New
listDatasources
function - thanks to @jeevansai502 for the contribution!
Bug fixes
- #1349 Fix bug in
JSON
andYAML
functions where escaped forward slashes (\/
) were not being correctly interpreted - #1350 Fix config merging when context/datasources are provided on the command line but not in the config file - thanks to @paddycarey for the contribution!
- #1334 Fix file directory reading (fixes #1333)
- #1310 Fix
strings.Title
to handle unicode punctuation (moves to alternate implementation after Go 1.18 deprecated the standard library function) - #1308 Fix bug where
strings.Indent
would not work correctly when a new-line character is used (now disallowed) - #1296 The
aws+sm
datasource will now correctly read a secret written as binary (SecretBinary
) rather than a string (SecretString
)
Documentation fixes/updates
- #1338 Clarify that
inputDir
is read recursively - #1313 Add MacPorts installation instructions - thanks to @herbygillot for the contribution!
- #1312 Improved plugin documentation
- #1309 Updated install docs to remove mention of the deprecated
slim
binary, and update the Go install instructions for recent Go versions - #1301
conv.URL
: Add example of how to redact the password - #1300
time.Now
: Add example of how to useTime.IsDST
- #1279
strings.Split
: More examples to clarify how to usestrings.Split
- thanks to @karlschriek for the contribution!