Skip to content

Releases: gruntwork-io/go-commons

v0.7.2

22 Jan 14:30
571dadf
Compare
Choose a tag to compare

Modules affected

  • shell

Description

  • Add new functions to allow getting the stdout from a running command.

Related links

#38

v0.7.1

14 Dec 20:03
6fc74d4
Compare
Choose a tag to compare

Modules affected

  • version [NEW MODULE]
  • entrypoint

Description

  • Added a new version package that can be used to set the VERSION variable from the CLI, and return the version via version.Version(). This reduces the boilerplate needed for managing version numbers in CLI apps. See the version package and updated README for more details.
  • Fixed some minor string formatting in entrypoint.

Related links

#37

v0.7.0

19 Aug 21:23
2045b19
Compare
Choose a tag to compare

Modules affected

  • logging [BACKWARDS INCOMPATIBLE]

Description

logging.GetLogger now returns a new logger using a custom formatter that prefixes the given name to the log entries.

Related links

#32

v0.6.1

06 Feb 16:32
00c7cf8
Compare
Choose a tag to compare

Modules affected

  • entrypoint

Description

  • Support using both WithStackTrace and ErrorWithExitCode, so that you can get both a stack trace and exit with exit code.
  • Output the underlying error message instead of ErrorWithExitCode{ Err = Deployment failed, ExitCode = 1 }

Related links

v0.6.0

29 Jan 23:13
ff0f6f3
Compare
Choose a tag to compare

Description

This release switches the dependency management from dep to go modules. This means that any go libraries and tools that are including this repo will need to switch to go modules from this release onward.

Related links

v0.5.1

13 Aug 19:10
2b40fc3
Compare
Choose a tag to compare

Modules affected

  • random [NEW]

Description

This release introduces a new module random, which exposes utility functions for generating random items.

  • random.RandomString can be used for generating random strings of specified lengths, pooling from a set of allowed characters passed into the function. For example, to generate a 32 char string only composing of digits, you can do random.RandomString(32, random.Digits). Additionally, you can do random.RandomString(32, random.LowerLetters + random.SpecialChars) to generate a 32 char string composing of lowercase letters (a-z) and special characters.

Related links

v0.5.0

13 Aug 04:53
1ee0c10
Compare
Choose a tag to compare

Modules affected

  • shell [BREAKING CHANGE]

Description

  • You can now set additional environment variables in the execution context for running commands using the shell module. This is handled by setting the Env attribute on ShellOptions.

Migration guide

If you were manually constructing ShellOptions, you will need to ensure you initialize Env to an empty map. For example, if you had:

options := shell.ShellOptions{}

in your code, you will need to update to initialize Env:

options := shell.ShellOptions{Env: map[string]string{}}
// OR
options.Env = map[string]string{}

Note that if you were using shell.NewShellOptions to initialize the ShellOptions, then you do not need to change anything.

Related links

v0.4.2

19 Dec 18:38
6a21631
Compare
Choose a tag to compare

Modules affected

  • collections

Description

  • Adds BatchListIntoGroupsOf function, which will take a list and return a list of lists that batches the original list into groups of batchSize elements.

Related links

v0.4.1

30 Nov 14:54
8b5d2a7
Compare
Choose a tag to compare

Modules affected

  • entrypoint

Description

  • Help text for nested subcommands now follow the same pattern as the app level help text.

Related links

v0.4.0

28 Nov 22:56
bce40c5
Compare
Choose a tag to compare

Modules affected

  • shell
  • entrypoint

Description

  • There are now new functions to assert required arguments passed into the CLI: StringFlagRequiredE and EnvironmentVarRequiredE. (This is in entrypoint package).
  • There is now a E variant for CommandInstalled in the entrypoint package.
  • (Backwards incompatible) Stack traces in error messages are now suppressed by default, printing only a simple error message. This leads to better user experience at the expense of potential debuggability. The old behavior can still be restored if the command is run with the environment variable GRUNTWORK_DEBUG set to something other than empty string.

Related links