closers

package
v0.0.0-...-05ee0c8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package closers provides utilities for working with io.Closer implementations.

Index

Constants

This section is empty.

Variables

View Source
var Noop = CloseFunc(func() error {
	return nil
})

Noop is an io.Closer implementation that returns nil on Close.

Functions

func Close

func Close(c io.Closer)

Close the provided io.Closer implementation, logging if there's an error. This is typically used with a defer statement.

Types

type CloseFunc

type CloseFunc func() error

CloseFunc is used as an adaptor to create io.Closer implementations for functions.

func (CloseFunc) Close

func (c CloseFunc) Close() error

Close the CloseFunc.

Jump to

Keyboard shortcuts

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