shims

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(code int)

Function being mocked

func OverrideExit added in v0.0.4

func OverrideExit(handler ExitHandler) override.Override

func OverrideHomeDir added in v0.0.4

func OverrideHomeDir(handler HomeDirHandler) override.Override

func Stderr

func Stderr() *os.File

func Stdin

func Stdin() *os.File

func Stdout

func Stdout() *os.File

func UserHomeDir

func UserHomeDir() (string, error)

Function being mocked

func WithStderr

func WithStderr(stderr *os.File, fun func())

func WithStdin

func WithStdin(stdin *os.File, fun func())

func WithStdout

func WithStdout(stdout *os.File, fun func())

Types

type ExitHandler

type ExitHandler interface {
	Handle(code int)
}

Handler for mocking os.Exit()

type FileStreams

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

type HomeDirHandler

type HomeDirHandler interface {
	Handle() (string, error)
}

Handler for mocking os.UserHomeDir()

type IgnoreExitHandler

type IgnoreExitHandler struct{}

Handler implementation to ignore exits

func (IgnoreExitHandler) Handle

func (h IgnoreExitHandler) Handle(code int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳