errors

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 2 Imported by: 15

README

errors

GoDoc Go

A simple wrapper around stdlib errors package, that adds a Wrap function.

go get maragu.dev/errors

Made in 🇩🇰 by maragu, maker of online Go courses.

Documentation

Overview

Package errors provides Wrap in addition to the functions in the errors package. It also provides Newf which is a wrapper around fmt.Errorf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

As calls errors.As.

func Is

func Is(err, target error) bool

Is calls errors.Is.

func Join added in v0.3.0

func Join(errs ...error) error

Join calls errors.Join.

func New

func New(text string) error

New calls errors.New.

func Newf

func Newf(format string, a ...interface{}) error

Newf calls fmt.Errorf.

func Unwrap

func Unwrap(err error) error

Unwrap calls errors.Unwrap.

func Wrap

func Wrap(err error, format string, a ...interface{}) error

Wrap an error with a message, or return nil if err is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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