gocommand

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package gocommand is a helper for calling the go command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invocation

type Invocation struct {
	Verb       string
	Args       []string
	BuildFlags []string
	Env        []string
	WorkingDir string
	Logf       func(format string, args ...interface{})
}

An Invocation represents a call to the go command.

func (*Invocation) Run added in v1.0.0

func (i *Invocation) Run(ctx context.Context) (*bytes.Buffer, error)

Run runs the invocation, returning its stdout and an error suitable for human consumption, including stderr.

func (*Invocation) RunRaw added in v1.0.0

func (i *Invocation) RunRaw(ctx context.Context) (stdout *bytes.Buffer, stderr *bytes.Buffer, friendlyError error, rawError error)

RunRaw is like Run, but also returns the raw stderr and error for callers that want to do low-level error handling/recovery.

Jump to

Keyboard shortcuts

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