Skip to content

gravitational/trace

Repository files navigation

Trace

GoDoc Test workflow

Package for error handling and error reporting

Read more here:

https://goteleport.com/blog/golang-error-handling/

Capture file, line and function

import (
     "github.com/gravitational/trace"
)

func someFunc() error {
   return trace.Wrap(err)
}


func main() {
  err := someFunc()
  fmt.Println(err.Error()) // prints file, line and function
}