Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFakeWriter = errors.New("naza.fake: a fake writer error")
)
Functions ¶
func OS_Exit ¶ added in v0.10.0
func OS_Exit(code int)
正常情况下,调用 os.Exit,单元测试时,可通过调用 WithFakeExit 配置为不调用 os.Exit
func WithFakeTimeNow ¶ added in v0.10.0
func WithRecover ¶ added in v0.10.0
func WithRecover(f func())
Types ¶
type ExitResult ¶ added in v0.7.0
func WithFakeOSExit ¶ added in v0.10.0
func WithFakeOSExit(fn func()) ExitResult
type Writer ¶
func NewWriter ¶
func NewWriter(t WriterType) *Writer
func (*Writer) SetSpecificType ¶
func (w *Writer) SetSpecificType(ts map[uint32]WriterType)
为某些写操作指定特定的类型,次数从 0 开始计数
type WriterType ¶
type WriterType uint8
const ( WriterTypeDoNothing WriterType = iota WriterTypeReturnError WriterTypeIntoBuffer )
Click to show internal directories.
Click to hide internal directories.