ioutils

package
v0.0.0-...-5b64428 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrainClose

func DrainClose(reader io.Reader) (*bytes.Buffer, error)

DrainClose will read all bytes of an io.Reader into a bytes.Buffer, to allow it to be used multiple times.

If the reader is a *bytes.Buffer, a new bytes.Buffer will be returned from its backing []byte slice.

It will also attempt to Close any provided reader, if it implements the io.Closer iface.

func TryClose

func TryClose(maybeClosers ...interface{})

TryClose tries to cast all provided params to io.Closer, and, if successful, calls Close on each.

Types

This section is empty.

Jump to

Keyboard shortcuts

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