Documentation
¶
Overview ¶
Package req provides methods to resolve Go oriented tooling paths, and if not found attempts to install on demand.
This simplifies other packages so they don't need to worry about installing tools each time. Instead the packages get installed on demand when called.
Example:
Let's say you run mage secrets:check but don't have gitleaks installed.
The package tasks will run the check, but if the binary for gitleaks isn't found, then it would attempt to run the `go install github.com/zricethezav/gitleaks/v8` command, resolve the path, and provide this pack to the caller.
Overtime, I've started migrating more to this approach as it means you have far less concerns for tools like this to run any install/init style setup, and instead just let it self-setup as needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QualifyGoBinary ¶
QualifyGoBinary provides a fully qualified path for an installed Go binary to avoid path issues.
func ResolveBinaryByInstall ¶
ResolveBinaryByInstall tries to qualify the Go tool path, but if can't find it, it will attempt to install and try again once.
This can help with running in CI and not having to have a lot of setup code.
Types ¶
This section is empty.