gocmd

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadModules added in v1.0.0

func DownloadModules(logger zerolog.Logger, modules []string, stdout, stderr io.Writer) error

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

func GetEnv(logger zerolog.Logger) (map[string]string, error)

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

func GetModuleGraph(logger zerolog.Logger, moduleDir string, writer io.Writer) error

GetModuleGraph executes `go mod graph` and writes the output to a given writer. See https://golang.org/ref/mod#go-mod-graph.

func GetVersion

func GetVersion(logger zerolog.Logger) (string, error)

GetVersion returns the version of Go in the environment.

func ListModule added in v1.0.0

func ListModule(logger zerolog.Logger, moduleDir string, writer io.Writer) error

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

func ListModules(logger zerolog.Logger, moduleDir string, writer io.Writer) error

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

func ListPackage(logger zerolog.Logger, moduleDir, packagePattern string, writer io.Writer) error

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

func ListPackages(logger zerolog.Logger, moduleDir, packagePattern string, writer io.Writer) error

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

func ListVendoredModules(logger zerolog.Logger, moduleDir string, writer io.Writer) error

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

func LoadBuildInfo(logger zerolog.Logger, binaryPath string, writer io.Writer) error

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

func ModWhy(logger zerolog.Logger, moduleDir string, modules []string, writer io.Writer) error

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

func ParseVersion(s string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL