gocmd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CommandInstall represents go "install" command.
	CommandInstall = "install"

	// 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"
)
View Source
const (
	FlagMod              = "-mod"
	FlagModValueReadOnly = "readonly"
	FlagLdflags          = "-ldflags"
	FlagOut              = "-o"
)
View Source
const (
	EnvGOOS   = "GOOS"
	EnvGOARCH = "GOARCH"
)

Variables

This section is empty.

Functions

func BuildAll

func BuildAll(ctx context.Context, out, path string, flags []string, options ...exec.Option) error

BuildAll runs go build ./... on path with options.

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

func BuildTarget(goos, goarch string) string

BuildTarget builds a GOOS:GOARCH pair.

func InstallAll

func InstallAll(ctx context.Context, path string, flags []string, options ...exec.Option) error

InstallAll runs go install ./... on path with options.

func Ldflags

func Ldflags(flags ...string) string

Ldflags returns a combined ldflags set from flags.

func ModTidy

func ModTidy(ctx context.Context, path string, options ...exec.Option) error

ModTidy runs go mod tidy on path with options.

func ModVerify

func ModVerify(ctx context.Context, path string, options ...exec.Option) error

ModVerify runs go mod verify on path with options.

func Name

func Name() string

Name returns the name of Go binary to use.

func PackageLiteral

func PackageLiteral(path, version string) string

PackageLiteral returns the string representation of package part of go get [package].

func ParseTarget

func ParseTarget(t string) (goos, goarch string, err error)

ParseTarget parses GOOS:GOARCH pair.

Types

This section is empty.

Jump to

Keyboard shortcuts

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