v0.4.0
This release did not introduce new functionalities, but rather implemented fixes and improvements that have been lingering for a while.
Release overview
- Better support for setting Stdout/Stderr when working with
exec
package - Fixed out-of-order bug that would make
exec.Proc.Resut()
andexec.Proc.Out()
calls return empty result from the process - Additional checked error propagation in API call chain in several packages
- Enhancements to
exec.CommandBuilder
to fix piped commands constructs - Ability to set stdout/stderr for batch commands with exec.CommandBuilder
- Further standardization of function and method signatures for packages
http
andfs
- Enhancements to internal tests
API changes
Package exec
changes
Previously, method Proc.Out()
in package exec
would automatically start a defined process (if not started) then return output of the process as a combined Stdout/Stderr streams. This behavior has been simplified:
- The API user is responsible for starting the process prior to calling
proc.Out()
- Method
Proc.Out()
only returns the combined output stream if no other streams were set for the process - If other streams were set, an API user is responsible for accessing the configured output stream for process result.
Method proc.Result()
still returns the combined output stream as string
(by calling proc.Out()
) if an output stream was not explicitly set.
See example here
Package vars
changes
This release introduces subtle changes to how methods vars.Variables.Envs
and vars.Variables.Vars
work. Before this release, these methods accepted a single string with key=value
pairs separated by spaces:
gexe.Vars(`msg0=hello msg1=world`).
In this release, however, the signatures for both Envs
and Vars
have been updated as variadic methods that accept zero or more string values. Each string parameter is not expected to provide a single key=value
pair:
gexe.Envs(`GOOS="linux"`, `GOARCH=arm64`).Run(`go build .`)
Note that this change provides the flexibility of specifying variables with quoted values and supports spaces in the values.
Related PRs
- Functionality improvements by @vladimirvivien in #53
- Lock contention fix by @vladimirvivien in #54