safeclose

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: Apache-2.0 Imports: 4 Imported by: 176

Documentation

Overview

Package safeclose provides utilities for safe closing of I/O resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(objs ...interface{}) error

Close tries to close all objects and return all errors using CloseErrors if there are any.

func CloseAll

func CloseAll(objs ...interface{}) ([]error, error)

CloseAll tries to close all objects and return all errors (there are nils if there was no errors). DEPRECATED - use safeclose.Close(...) instead

Types

type CloseErrors added in v1.4.0

type CloseErrors []error

CloseErrors merges multiple errors into single type for simpler use.

func (CloseErrors) Error added in v1.4.0

func (e CloseErrors) Error() string

Error implements error interface.

Jump to

Keyboard shortcuts

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