tools: Index | Files

package gocommand

import ""

Package gocommand is a helper for calling the go command.


Package Files


type Invocation Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

Package gocommand imports 11 packages (graph) and is imported by 10 packages. Updated 2020-04-09. Refresh now. Tools for package owners.