iotest

package
v3.116.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package iotest provides testing utilities for code that uses the io package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogWriter

func LogWriter(t testing.TB) io.Writer

LogWriter builds and returns an io.Writer that writes messages to the given testing.TB. It ensures that each line is logged separately.

Any trailing buffered text that does not end with a newline is flushed when the test finishes.

The returned writer is safe for concurrent use from multiple parallel tests.

func LogWriterPrefixed

func LogWriterPrefixed(t testing.TB, prefix string) io.Writer

LogWriterPrefixed is a variant of LogWriter that prepends the given prefix to each line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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