gogo

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 8 Imported by: 4

README

Go Go

The gogo package is a Go wrapper around the Go compiler toolchain.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ValidCompilerTargets - Supported compiler targets
	ValidCompilerTargets = map[string]bool{
		"aix/ppc64":       true,
		"android/386":     true,
		"android/amd64":   true,
		"android/arm":     true,
		"android/arm64":   true,
		"darwin/amd64":    true,
		"darwin/arm64":    true,
		"dragonfly/amd64": true,
		"freebsd/386":     true,
		"freebsd/amd64":   true,
		"freebsd/arm":     true,
		"freebsd/arm64":   true,
		"illumos/amd64":   true,
		"ios/amd64":       true,
		"ios/arm64":       true,
		"js/wasm":         true,
		"linux/386":       true,
		"linux/amd64":     true,
		"linux/arm":       true,
		"linux/arm64":     true,
		"linux/mips":      true,
		"linux/mips64":    true,
		"linux/mips64le":  true,
		"linux/mipsle":    true,
		"linux/ppc64":     true,
		"linux/ppc64le":   true,
		"linux/riscv64":   true,
		"linux/s390x":     true,
		"netbsd/386":      true,
		"netbsd/amd64":    true,
		"netbsd/arm":      true,
		"netbsd/arm64":    true,
		"openbsd/386":     true,
		"openbsd/amd64":   true,
		"openbsd/arm":     true,
		"openbsd/arm64":   true,
		"openbsd/mips64":  true,
		"plan9/386":       true,
		"plan9/amd64":     true,
		"plan9/arm":       true,
		"solaris/amd64":   true,
		"windows/386":     true,
		"windows/amd64":   true,
		"windows/arm":     true,
	}
)

Functions

func GarbleCmd added in v1.4.0

func GarbleCmd(config GoConfig, cwd string, command []string) ([]byte, error)

GarbleCmd - Execute a go command

func GetGoCache added in v1.4.0

func GetGoCache(appDir string) string

GetGoCache - Get the OS temp dir (used for GOCACHE)

func GetGoModCache added in v1.4.0

func GetGoModCache(appDir string) string

GetGoModCache - Get the GoMod cache dir

func GetGoRootDir

func GetGoRootDir(appDir string) string

GetGoRootDir - Get the path to GOROOT

func GoBuild

func GoBuild(config GoConfig, src string, dest string, buildmode string, tags []string, ldflags []string, gcflags, asmflags string, trimpath string) ([]byte, error)

GoBuild - Execute a go build command, returns stdout/error

func GoCmd

func GoCmd(config GoConfig, cwd string, command []string) ([]byte, error)

GoCmd - Execute a go command

func GoMod added in v1.4.0

func GoMod(config GoConfig, src string, args []string) ([]byte, error)

GoMod - Execute go module commands in src dir

func GoVersion

func GoVersion(config GoConfig) ([]byte, error)

GoVersion - Execute a go version command, returns stdout/error

Types

type GoConfig

type GoConfig struct {
	ProjectDir string

	GOOS       string
	GOARCH     string
	GOROOT     string
	GOCACHE    string
	GOMODCACHE string
	CGO        string
	CC         string

	Obfuscation bool
	GOPRIVATE   string
}

GoConfig - Env variables for Go compiler

Jump to

Keyboard shortcuts

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