go-errors

module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT

README

Go Errors Detail

Project status Go Report Card Coverage Status Open Source Helpers GoDoc License

The go-errors project came to make the return of errors, very common in Golang, clearer, thus facilitating the debugging of your applications.

Installation

Use go get.

go get github.com/GabrielHCataldo/go-errors

Then import the go-errors package into your own code.

import "github.com/GabrielHCataldo/go-errors/errors"

Usability and documentation

IMPORTANT: Always check the documentation in the structures and functions fields. For more details on the examples, visit All examples link

Simple example
package main

import (
    "github.com/GabrielHCataldo/go-errors/errors"
    "github.com/GabrielHCataldo/go-logger/logger"
)

func main() {
    err := simple()
    logger.Error("simple err:", err)
}

func simple() error {
    return errors.New("error by message with any value", 2, true)
}

Output:

[ERROR 2024/01/24 05:05:25] main.go:10: simple err: [_example/main.go:14] simple: error by message with any value 2 true

How to contribute

Make a pull request, or if you find a bug, open it an Issues.

License

Distributed under MIT license, see the license file within the code for more details.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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