Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Last active March 26, 2023 05:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rms1000watt/8f9c9c304f71520c42962b5c569393aa to your computer and use it in GitHub Desktop.
Save rms1000watt/8f9c9c304f71520c42962b5c569393aa to your computer and use it in GitHub Desktop.
Golang Errors Stacktrace and Line Number
// https://godoc.org/github.com/pkg/errors#Frame.Format
package main
import (
"fmt"
"github.com/pkg/errors"
)
func main() {
err := errors.New("Error generated here")
if err != nil {
fmt.Printf("ERROR: %+v\r\n", errors.Wrap(err, ""))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment