Documentation ¶
Index ¶
- func GOPATH() (string, error)
- func PkgPath(subDir, pkg string) string
- func SrcDir(pkg string) string
- func SrcFile(f string) string
- type ExecEnv
- func (env *ExecEnv) BindPipe(w io.Writer)
- func (env *ExecEnv) Call(dir, name string, args ...string) (bool, error)
- func (env *ExecEnv) Cmd(j *ExecJob) *exec.Cmd
- func (env *ExecEnv) Context() *build.Context
- func (env *ExecEnv) Exec(dir, name string, args ...string) error
- func (env *ExecEnv) GOPATH() string
- func (env *ExecEnv) IsDir(p string) (bool, error)
- func (env *ExecEnv) PipedCmd(j *ExecJob) *exec.Cmd
- func (env *ExecEnv) StrOut(dir, name string, args ...string) (string, error)
- type ExecJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GOPATH ¶
GOPATH returns GOPATH reading from environment variables. If GOPATH is missing it returns $HOME/go.
func PkgPath ¶
PkgPath returns the file path of a sub directory (e.g. src, bin, etc.) for a particular package.
Types ¶
type ExecEnv ¶
type ExecEnv struct {
// contains filtered or unexported fields
}
ExecEnv is an execution environment for executing a Go language related command.
func NewExecEnv ¶
NewExecEnv creates a new execution environment for a particular GOPATH.
func (*ExecEnv) BindPipe ¶
BindPipe will forward stdout and stderr to the given writer, rather than os.Stdout and os.Stderr.
func (*ExecEnv) Call ¶
Call executes a process in the environment and returns true if the process ends and exits with a success exit code, false if the process ends and exists with a non-success exit code.
func (*ExecEnv) Cmd ¶
Cmd creates an execution process using a given execution job.
func (*ExecEnv) Context ¶
Context returns the build context that is used by this environment.
func (*ExecEnv) Exec ¶
Exec executes a process in the environment.
func (*ExecEnv) GOPATH ¶
GOPATH returns the GOPATH for this environment.
func (*ExecEnv) IsDir ¶
IsDir checks if p exists as a directory under the GOPATH.
func (*ExecEnv) PipedCmd ¶
PipedCmd creates an execution process using a given execution job similar to Cmd but also forward through the Stdout and Stderr.