command

package
v0.0.0-...-a0e73d3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCommand

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

type MockRunner

type MockRunner struct {
	FailOnUnexpectedCalls bool
	// contains filtered or unexported fields
}

func NewMockRunner

func NewMockRunner(t *testing.T) *MockRunner

func (*MockRunner) AssertAllCalled

func (m *MockRunner) AssertAllCalled()

func (*MockRunner) AssertCalled

func (m *MockRunner) AssertCalled(commandAndArgs string)

func (*MockRunner) ErrorOnCall

func (m *MockRunner) ErrorOnCall(commandAndArgs string, err error)

func (*MockRunner) MkdirAll

func (m *MockRunner) MkdirAll(path string, perm os.FileMode) error

func (*MockRunner) OutputOnCall

func (m *MockRunner) OutputOnCall(commandAndArgs string, output string)

func (*MockRunner) RegisterDeviceForStat

func (m *MockRunner) RegisterDeviceForStat(path string)

func (*MockRunner) RegisterDirectoryForStat

func (m *MockRunner) RegisterDirectoryForStat(path string)

func (*MockRunner) RegisterMkdirAll

func (m *MockRunner) RegisterMkdirAll(path string)

func (*MockRunner) Run

func (m *MockRunner) Run(commandAndArgs ...string) (string, error)

func (*MockRunner) Stat

func (m *MockRunner) Stat(path string) (os.FileInfo, error)

type Runner

type Runner struct{}

func (Runner) MkdirAll

func (r Runner) MkdirAll(path string, perm os.FileMode) error

func (Runner) Run

func (r Runner) Run(commandAndArgs ...string) (string, error)

Wrap around os.exec.Command(...).CombinedOutput() to glue together output (STDERR+STDOUT) and execution error message upon failure.

Convert the []byte output to string as well.

func (Runner) Stat

func (r Runner) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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