errutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package errutil implements common error types and helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertionFailure

func AssertionFailure(format string, args ...interface{}) error

AssertionFailure is used for an error resulting from the failure of an expected invariant.

func CheckClose

func CheckClose(errp *error, c io.Closer)

CheckClose closes c. If an error occurs it will be written to the error pointer errp, if it doesn't already reference an error. This is intended to allow you to properly check errors when defering a close call. In this case the error pointer should be the address of a named error return.

func UnexpectedType

func UnexpectedType(t interface{}) error

UnexpectedType builds an error for an unexpected type, typically in a type switch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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