mock

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package mock provide a mocking for standard output and standard error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close all mocked output and/or error.

func Error

func Error() string

Error get stream of standard error as string.

func Output

func Output() string

Output get stream of standard output.

func Reset

func Reset(truncate bool)

Reset all mocked standard output and error.

func ResetStderr

func ResetStderr(truncate bool)

ResetStderr reset mocked standard error offset back to 0. If truncated is true, it also reset the size to 0.

func ResetStdin

func ResetStdin(truncate bool)

ResetStdin reset mocked standard input offset back to 0. If truncated is true, it also reset the size to 0.

func ResetStdout

func ResetStdout(truncate bool)

ResetStdout reset mocked standard output offset back to 0. If truncated is true, it also reset the size to 0.

func Stderr

func Stderr() *os.File

Stderr mock standard error to temporary file.

func Stdin

func Stdin() *os.File

Stdin mock the standar input using temporary file.

func Stdout

func Stdout() *os.File

Stdout mock standard output to temporary file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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