runner

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runnable

type Runnable interface {
	GoVersion() *semver.Version
	List(args ...string) (string, error)
	GetD(packages ...string) (string, error)
	Build(pkg, out string, args ...string) error
	GoEnv(args ...string) (string, error)
	ModDownload(args ...string) error
}

type Runner

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

Runner allows to run certain commands against module aware Go CLI.

func NewRunner

func NewRunner(ctx context.Context, logger *log.Logger, insecure bool, goCmd string) (*Runner, error)

NewRunner checks Go version compatibility then returns Runner.

func (*Runner) GoVersion added in v0.3.0

func (r *Runner) GoVersion() *semver.Version

func (*Runner) ModInit added in v0.3.0

func (r *Runner) ModInit(ctx context.Context, cd, modFile, moduleName string) error

ModInit runs `go mod init` against separate go modules files if any.

func (*Runner) Verbose

func (r *Runner) Verbose()

func (*Runner) With

func (r *Runner) With(ctx context.Context, modFile string, dir string, extraEnvVars envars.EnvSlice) Runnable

With returns runner that will be ran against give modFile (if any), in given directory (if any), with given extraEnvVars on top of Environ.

Jump to

Keyboard shortcuts

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