Documentation ¶
Index ¶
- Constants
- func Build(ctx context.Context, out, path string, flags []string, options ...exec.Option) error
- func BuildPath(ctx context.Context, output, binary, path string, flags []string, ...) error
- func BuildTarget(goos, goarch string) string
- func Env(name string) (string, error)
- func Fmt(ctx context.Context, path string, options ...exec.Option) error
- func Get(ctx context.Context, path string, pkgs []string, options ...exec.Option) error
- func Install(ctx context.Context, path string, pkgs []string, options ...exec.Option) error
- func InstallAll(ctx context.Context, path string, flags []string, options ...exec.Option) error
- func IsInstallError(err error) bool
- func Ldflags(flags ...string) string
- func ModTidy(ctx context.Context, path string, options ...exec.Option) error
- func ModVerify(ctx context.Context, path string, options ...exec.Option) error
- func Name() string
- func PackageLiteral(path, version string) string
- func ParseTarget(t string) (goos, goarch string, err error)
- func Tags(tags ...string) string
Constants ¶
View Source
const ( // CommandInstall represents go "install" command. CommandInstall = "install" // CommandGet represents go "get" command. CommandGet = "get" // CommandBuild represents go "build" command. CommandBuild = "build" // CommandMod represents go "mod" command. CommandMod = "mod" // CommandModTidy represents go mod "tidy" command. CommandModTidy = "tidy" // CommandModVerify represents go mod "verify" command. CommandModVerify = "verify" // CommandFmt represents go "fmt" command. CommandFmt = "fmt" // CommandEnv represents go "env" command. CommandEnv = "env" // EnvGOARCH represents GOARCH variable. EnvGOARCH = "GOARCH" // EnvGOMOD represents GOMOD variable. EnvGOMOD = "GOMOD" // EnvGOOS represents GOOS variable. EnvGOOS = "GOOS" // FlagGcflags represents gcflags go flag. FlagGcflags = "-gcflags" // FlagGcflagsValueDebug represents debug go flags. FlagGcflagsValueDebug = "all=-N -l" // FlagLdflags represents ldflags go flag. FlagLdflags = "-ldflags" // FlagTags represents tags go flag. FlagTags = "-tags" // FlagMod represents mod go flag. FlagMod = "-mod" // FlagModValueReadOnly represents readonly go flag. FlagModValueReadOnly = "readonly" // FlagOut represents out go flag. FlagOut = "-o" )
Variables ¶
This section is empty.
Functions ¶
func BuildPath ¶
func BuildPath(ctx context.Context, output, binary, path string, flags []string, options ...exec.Option) error
BuildPath runs go install on cmd folder with options.
func BuildTarget ¶
BuildTarget builds a GOOS:GOARCH pair.
func InstallAll ¶
InstallAll runs go install ./... on path with options.
func IsInstallError ¶ added in v0.27.0
IsInstallError returns true if err is interpreted as a go install error.
func PackageLiteral ¶
PackageLiteral returns the string representation of package part of go get [package].
func ParseTarget ¶
ParseTarget parses GOOS:GOARCH pair.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.