Categorygithub.com/go-zoox/errors
repositorypackage
1.0.2
Repository: https://github.com/go-zoox/errors.git
Documentation: pkg.go.dev

# README

errors - Simple Errors Wrapper

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/errors

Getting Started

package main

import (
    stderrors "errors"

    "github.com/go-zoox/errors"
)

func main() {
    err := f3()
    
    fmt.Println(err)
}

func f1() error {
    return errors.New("string1")
}

func f2() error {
    return errors.Wrap(f1(), "custom message f2")
}

func f3() error {
    return errors.Wrapf(f2(), "custom message f3 %s", "test")
}

Inspired by

  • PumpkinSeed/errors - Simple and efficient error package.
  • bnkamalesh/errors - A drop-in replacement for Go errors, with some added sugar! Unwrap user-friendly messages, HTTP status code, easy wrapping with multiple error types.
  • pkg/errors - imple error handling primitives.

License

GoZoox is released under the MIT License.