mocking

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ThrowError = func() error {
	return errors.New("always fails")
}

Functions

func DoSomeStuff

func DoSomeStuff(d DoStuffer) error

Types

type DoStuffer

type DoStuffer interface {
	DoStuff(input string) error
}

DoStuffer is a simple interface

type Restorer

type Restorer func()

Restorer holds a function that can be used to restore some previous state.

func Patch

func Patch(dest, value interface{}) Restorer

Patch sets the value pointed to by the given destination to the given value, and returns a function to restore it to its original value. The value must be assignable to the element type of the destination.

func (Restorer) Restore

func (r Restorer) Restore()

Restore restores some previous state.

Jump to

Keyboard shortcuts

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