//Trace prefixes a basic trace to the given error.
//Uses function name & current line-number.
//ie DoSomething:3
Trace prefixes a basic trace to the given error.
Uses function name & current line-number.
ie DoSomething:3
// Trace prefixes a basic trace to the given error . // Uses function name & current line - number . // ie DoSomething : 3
func Trace(err error) (out error) {
	if err == nil {
		return nil
	}
	pc, _, line, ok := runtime.Caller(1)
	if ok {
		frame, _ := runtime.CallersFrames([]uintptr{pc}).Next()
		var splits = strings.Split(frame.Function, ".")
		var name = splits[len(splits)-1]
		out = fmt.Errorf("(%v:%v) %w", name, line, err)
	}
	return
}
func Trace ( err error ) ( out error ) { if err == nil { return nil } pc , _ , line , ok := runtime . Caller ( 1 ) if ok { frame , _ := runtime . CallersFrames ( [ ] uintptr { pc } ) . Next ( ) var splits = strings . Split ( frame . Function , " " ) var name = splits [ len ( splits ) - 1 ] out = fmt . Errorf ( " " , name , line , err ) } return }
Trace prefixes a basic trace to the given error.
Trace prefixes a basic trace to the given error .