gotool

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Test goTest = runGoTest

Test runs `go test` and provides optionals for adding command line arguments.

Functions

func HasTests

func HasTests(pkg string) (bool, error)

HasTests returns true if the given package contains test files.

func ListPackages

func ListPackages(pkgs ...string) ([]string, error)

ListPackages calls `go list` for every package spec given.

func ListProjectPackages

func ListProjectPackages() ([]string, error)

ListProjectPackages lists all packages in the current project

func ListTestFiles

func ListTestFiles(pkg string) ([]string, error)

ListTestFiles lists all go and cgo test files available in a package.

Types

type ArgOpt

type ArgOpt func(args *Args)

ArgOpt is a functional option adding info to Args once executed.

type Args

type Args struct {
	// contains filtered or unexported fields
}

Args holds parameters, environment variables and flag information used to pass to the go tool.

func (*Args) Add

func (a *Args) Add(p string)

Add adds a positional argument to be passed to the child process on exec.

func (*Args) Env

func (a *Args) Env(k, v string)

Env sets an environmant variable to be passed to the child process on exec.

func (*Args) Extra

func (a *Args) Extra(k, v string)

Extra sets a special k/v pair to be interpreted by the execution function.

func (*Args) Flag

func (a *Args) Flag(flag, value string)

Flag adds a flag to be passed to the child process on exec.

func (*Args) Val

func (a *Args) Val(k string) string

Val returns a special functions value for a given key.

Jump to

Keyboard shortcuts

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