loader

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(target, dir, prefix string, extraFlags ...string) (string, error)

Build compiles package target, and saves the resulting binary in directory dir with a file name starting with prefix, and a randomly generated suffix. On errors, the first returned value is "" and the error is non-nil.

Types

type Binary

type Binary struct {
	// Name of the package to build.
	Target string
	// Dir specifies the directory to save the binary in, and also the working
	// directory when the binary runs. If unset, the working directory of the
	// local process is used.
	Dir string
	// First part of the binary file name; the last part is generated randomly.
	Prefix string
	// Extra build flags
	BuildFlags []string
	// contains filtered or unexported fields
}

Binary includes the parameters for building (and running) a Go binary.

func (*Binary) Build

func (b *Binary) Build() error

Build compiles and saves the binary.

func (*Binary) Cmd

func (b *Binary) Cmd(args ...string) *exec.Cmd

Cmd returns an initialized *exec.Cmd for the binary described by b. The working directory is set to b.Dir.

Jump to

Keyboard shortcuts

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