Releases: gruntwork-io/go-commons
Releases · gruntwork-io/go-commons
v0.7.2
v0.7.1
Modules affected
version
[NEW MODULE]entrypoint
Description
- Added a new
version
package that can be used to set theVERSION
variable from the CLI, and return the version viaversion.Version()
. This reduces the boilerplate needed for managing version numbers in CLI apps. See theversion
package and updated README for more details. - Fixed some minor string formatting in
entrypoint
.
Related links
v0.7.0
v0.6.1
v0.6.0
v0.5.1
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 dorandom.RandomString(32, random.Digits)
. Additionally, you can dorandom.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
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 theEnv
attribute onShellOptions
.
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
v0.4.1
v0.4.0
Modules affected
shell
entrypoint
Description
- There are now new functions to assert required arguments passed into the CLI:
StringFlagRequiredE
andEnvironmentVarRequiredE
. (This is inentrypoint
package). - There is now a
E
variant forCommandInstalled
in theentrypoint
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.