goexe

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXIT_OK  = 0 // Zero exit code
	EXIT_BAD = 1 // General error exit code
)

Variables

This section is empty.

Functions

func Run

func Run(cmd *exec.Cmd, errMsg string) error

func RunCmd

func RunCmd(exePath string, workDir string, args ...string) (int, error)

Run runs the executable at 'exePath'. Setting the 'workDir' as empty will use the default as specified by functions that accept exec.Cmd. EXIT_OK is returned on successful execution otherwise EXIT_BAD or another non-zero exit code is returned.

Types

type Go

type Go struct {
	Path    string
	WorkDir string
}

Go represents a wrapper to the Go compiler. Functionality is provided for building, formatting, and testing.

func NewGo

func NewGo(workDir string) (Go, error)

NewGo returns a new Go struct. 'workDir' may be empty to signify the current working directory should be used.

func (Go) Build

func (g Go) Build(args ...string) error

func (Go) Fmt

func (g Go) Fmt(args ...string) error

func (Go) NewCmd

func (g Go) NewCmd(action string, args ...string) *exec.Cmd

func (Go) Test

func (g Go) Test(args ...string) error

func (Go) Vet

func (g Go) Vet(args ...string) error

Jump to

Keyboard shortcuts

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