Skip to content

v3.11.0

Compare
Choose a tag to compare
@hairyhenderson hairyhenderson released this 12 Jun 21:36
v3.11.0
a7685b1

👋 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:
  • 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)

Full Changelog

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 for templates for more information.
  • #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, and continue.
  • #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

Bug fixes

  • #1349 Fix bug in JSON and YAML 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 use Time.IsDST
  • #1279 strings.Split: More examples to clarify how to use strings.Split - thanks to @karlschriek for the contribution!