godo

package
v0.0.0-...-94f4d3e Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXIT_OK  = 0
	EXIT_BAD = 1
)

Variables

View Source
var WorkDirStack = []string{}

Functions

func Panik

func Panik(e error, m string, args ...interface{})

Panik prints the error before exiting with code 1. It does not generate a Go panic but simulates one without propagation, sorry for any confusion. Wraps 'e' with another error containing the format message 'm' if 'm' is not empty.

func Popd

func Popd() error

Popd emulates the popd bash functionality.

func Pushd

func Pushd(dir string) error

Pushd emulates pushd bash functionality.

func RemoveDir

func RemoveDir(dir string) (bool, error)

RemoveDir recursively removes directory 'dir'. If something was removed then true is returned rather than an error.

func Run

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

func Wrap

func Wrap(e error, m string, args ...interface{}) error

Wrap wraps an error 'e' with a another message 'm'.

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(dir, flags, pkg string) error

func (Go) Fmt

func (g Go) Fmt(pkg string) error

func (Go) FmtAll

func (g Go) FmtAll() error

func (Go) NewCmd

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

func (Go) Test

func (g Go) Test(pkg string, timeout string) error

func (Go) TestAll

func (g Go) TestAll(timeout string) error

Jump to

Keyboard shortcuts

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