ext

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ext contains some extra code which does not fit into the categorization of the stdlib.

Index

Constants

This section is empty.

Variables

View Source
var NoopCloser = CloserFunc(func() {})

NoopCloser is a dummy Closer implementation which can be used as a fallback.

Functions

func Close added in v0.5.0

func Close(closer interface{}) error

Close calls Close method on a struct if it implements the Closer interface.

Types

type Closer

type Closer interface {
	Close() error
}

Closer is an alias interface to io.Closer.

type CloserFunc

type CloserFunc func()

CloserFunc makes any function a Closer.

func (CloserFunc) Close

func (f CloserFunc) Close() (err error)

Close calls the underlying function and converts any panic to an error.

type Closers

type Closers []Closer

Closers is a collection of Closer instances.

func (Closers) Close

func (c Closers) Close() error

Close calls the underlying Closer instances and returns all their errors as a single value.

Directories

Path Synopsis
Package types provides a list of scalar and structure types.
Package types provides a list of scalar and structure types.

Jump to

Keyboard shortcuts

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