Categorygithub.com/k1LoW/errors
modulepackage
1.0.0
Repository: https://github.com/k1low/errors.git
Documentation: pkg.go.dev

# README

errors Go Reference CI Coverage Code to Test Ratio Test Execution Time

errors + stack staces.

Key features of k1LoW/errors are:

  • Retain the stack traces once stacked as far as possible.
  • It is possible to output stack traces in structured data.
  • Zero dependency

Usage

import (
    // "errors"
    "github.com/k1LoW/errors"
)

Example

https://go.dev/play/p/8zQvFThxI4O

Difference between errors and k1LoW/errors

  • The behaviour of methods with the same name as the errors package is the same.
  • k1LoW/errors has WithStack and StackTraces functions.

References

# Functions

As is a wrapper for [errors.As].
Is is a wrapper for [errors.Is].
Join is a wrapper for [errors.Join].
New is a wrapper for [errors.New].
StackTraces returns the stack traces of the given error(s).
Unwrap is a wrapper for [errors.Unwrap].
WithStack sets the stack trace for the given error.

# Variables

MaxStackDepth is the maximum depth of the stack trace.

# Structs

No description provided by the author