gocommand

package
v0.0.0-...-5a67fa7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: BSD-3-Clause Imports: 11 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) RunPiped

func (i *Invocation) RunPiped(ctx context.Context, stdout, stderr io.Writer) error

RunPiped is like Run, but relies on the given stdout/stderr

type Runner

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

An Runner will run go command invocations and serialize them if it sees a concurrency error.

func (*Runner) Run

func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error)

Run calls Runner.RunRaw, serializing requests if they fight over go.mod changes.

func (*Runner) RunRaw

func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error)

RunRaw calls Invocation.runRaw, serializing requests if they fight over go.mod changes.

Jump to

Keyboard shortcuts

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