Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sagar290/dda3514304930a7e21e080710dcda3d8 to your computer and use it in GitHub Desktop.
Save sagar290/dda3514304930a7e21e080710dcda3d8 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