shims

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(code int)

func Stderr

func Stderr() *os.File

func Stdin

func Stdin() *os.File

func Stdout

func Stdout() *os.File

func UserHomeDir

func UserHomeDir() (string, error)

func WithExitHandler

func WithExitHandler(handler ExitHandler, fun func())

func WithHomeDirHandler

func WithHomeDirHandler(handler HomeDirHandler, fun func() (string, error)) (string, error)

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{}

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