Go Errors Detail
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 result:", err)
}
func simple() error {
return errors.New("error by message with any value", 2, true)
}
Output:
[ERROR 2024/01/04 09:11:18] main.go:11: simple result: {"file":"/Users/gabrielcataldo/Innovfor/go-errors/_example/main.go","line":15,"message":"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.