Documentation ¶
Index ¶
- func DownloadModules(logger zerolog.Logger, modules []string, stdout, stderr io.Writer) error
- func GetEnv(logger zerolog.Logger) (map[string]string, error)
- func GetModuleGraph(logger zerolog.Logger, moduleDir string, writer io.Writer) error
- func GetVersion(logger zerolog.Logger) (string, error)
- func ListModule(logger zerolog.Logger, moduleDir string, writer io.Writer) error
- func ListModules(logger zerolog.Logger, moduleDir string, writer io.Writer) error
- func ListPackage(logger zerolog.Logger, moduleDir, packagePattern string, writer io.Writer) error
- func ListPackages(logger zerolog.Logger, moduleDir, packagePattern string, writer io.Writer) error
- func ListVendoredModules(logger zerolog.Logger, moduleDir string, writer io.Writer) error
- func LoadBuildInfo(logger zerolog.Logger, binaryPath string, writer io.Writer) error
- func ModWhy(logger zerolog.Logger, moduleDir string, modules []string, writer io.Writer) error
- func ParseVersion(s string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadModules ¶ added in v1.0.0
DownloadModules executes `go mod download -json` and writes the output to the given writers. See https://golang.org/ref/mod#go-mod-download.
func GetEnv ¶ added in v1.0.0
GetEnv executes `go env -json` and returns the result as a map. See https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information.
func GetModuleGraph ¶
GetModuleGraph executes `go mod graph` and writes the output to a given writer. See https://golang.org/ref/mod#go-mod-graph.
func GetVersion ¶
GetVersion returns the version of Go in the environment.
func ListModule ¶ added in v1.0.0
ListModule executes `go list -json -m` and writes the output to a given writer. See https://golang.org/ref/mod#go-list-m
func ListModules ¶ added in v0.6.0
ListModules executes `go list -json -m all` and writes the output to a given writer. See https://golang.org/ref/mod#go-list-m
func ListPackage ¶ added in v1.0.0
ListPackage executes `go list -json -e <PATTERN>` and writes the output to a given writer. See https://golang.org/cmd/go/#hdr-List_packages_or_modules.
func ListPackages ¶ added in v1.0.0
ListPackages executes `go list -deps -json <PATTERN>` and writes the output to a given writer. See https://golang.org/cmd/go/#hdr-List_packages_or_modules.
func ListVendoredModules ¶ added in v0.6.0
ListVendoredModules executes `go mod vendor -v` and writes the output to a given writer. See https://golang.org/ref/mod#go-mod-vendor.
func LoadBuildInfo ¶ added in v1.1.0
LoadBuildInfo executes `go version -m` and writes the output to a given writer. See https://golang.org/ref/mod#go-version-m.
func ModWhy ¶ added in v0.8.0
ModWhy executes `go mod why -m -vendor` and writes the output to a given writer. See https://golang.org/ref/mod#go-mod-why.
func ParseVersion ¶ added in v1.1.0
ParseVersion attempts to locate a Go version in a given string. Output of `go version` is not easily parseable in all cases. See https://github.com/golang/go/issues/21207
Types ¶
This section is empty.