Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.
/ multierror Public archive

A simple multierror library for combining errors

License

Notifications You must be signed in to change notification settings

simplylib/multierror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Status

This project is now archived since go1.20 is out and allows usage of errors.Join

migrating is as simple as switching multierror.Append to errors.Join

multierror

Go Reference Go Report Card

a simple package for handling horizontal errors as opposed to veritical (fmt.Errorf %w error wrapping)

Usage example from goreinstall:

func getGoBinaryInfo(ctx context.Context, path string) (info *buildinfo.BuildInfo, err error) {
  ...
  defer func() {
    if err2 := f.Close(); err2 != nil {
      err = multierror.Append(err, fmt.Errorf("file could not be closed due to error (%w)", err2))
    }
  }()
  ...
}

About

A simple multierror library for combining errors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages