Documentation ¶
Overview ¶
Package gox provides a spell incantation for the "github.com/mitchellh/gox" Go module command, a dead simple, no frills Go cross compile tool that behaves a lot like the standard Go toolchain "build" command.
See https://pkg.go.dev/github.com/mitchellh/gox for more details about "gox". The source code of the "gox" is available at https://github.com/mitchellh/gox.
Index ¶
- Constants
- Variables
- type Option
- func WithEnv(env map[string]string) Option
- func WithGoBuildOptions(goBuildOpts ...spellGoBuild.Option) Option
- func WithGoCmd(goCmd string) Option
- func WithGoOptions(goOpts ...spellGo.Option) Option
- func WithModulePath(path string) Option
- func WithModuleVersion(version *semver.Version) Option
- func WithOutputTemplate(outputTemplate string) Option
- func WithVerboseOutput(verbose bool) Option
- type Options
- type Spell
Constants ¶
const ( // DefaultGoModulePath is the default "gox" module command import path. DefaultGoModulePath = "github.com/mitchellh/gox" // DefaultGoModuleVersion is the default "gox" module version. DefaultGoModuleVersion = "v1.0.1" )
Variables ¶
var ( // DefaultCrossCompileBinaryNameTemplate is the default name template for cross-compilation binary artifacts. DefaultCrossCompileBinaryNameTemplate = func(name string) string { return name + "-{{.OS}}-{{.Arch}}" } // DefaultCrossCompileTargetPlatforms are the names of default cross-compile platform targets. // // See `go tool dist list` and https://github.com/golang/go/blob/master/src/cmd/dist/build.go // for more details and a list of supported platforms. DefaultCrossCompileTargetPlatforms = []string{ "darwin/amd64", "linux/amd64", "windows/amd64", } )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is a spell incantation option for the "github.com/mitchellh/gox" Go module command.
func WithGoBuildOptions ¶
func WithGoBuildOptions(goBuildOpts ...spellGoBuild.Option) Option
WithGoBuildOptions sets options for the Go toolchain "build" command.
func WithGoOptions ¶
WithGoOptions sets shared Go toolchain command options.
func WithModulePath ¶
WithModulePath sets the "gox" module command import path. Defaults to DefaultGoModulePath.
func WithModuleVersion ¶
func WithModuleVersion(version *semver.Version) Option
WithModuleVersion sets the "gox" module version. Defaults to DefaultGoModuleVersion.
func WithOutputTemplate ¶
WithOutputTemplate sets the name template for cross-compile platform targets. Defaults to DefaultCrossCompileBinaryNameTemplate.
func WithVerboseOutput ¶
WithVerboseOutput indicates whether the output should be verbose.
type Options ¶
type Options struct { *spellGoBuild.Options // contains filtered or unexported fields }
Options are spell incantation options for the "github.com/mitchellh/gox" Go module command.
func NewOptions ¶
NewOptions creates new spell incantation options for the "github.com/mitchellh/gox" Go module command.
type Spell ¶
type Spell struct {
// contains filtered or unexported fields
}
Spell is a spell incantation for the "github.com/mitchellh/gox" Go module command.
func New ¶
New creates a new spell incantation for the "github.com/mitchellh/gox" Go module command, a dead simple, no frills Go cross compile tool that behaves a lot like the standard Go toolchain "build" command.
func (*Spell) GoModuleID ¶
func (s *Spell) GoModuleID() *project.GoModuleID
GoModuleID returns partial Go module identifier information.