error.go
func New(e interface{}) *Error {
	var err error

	switch e := e.(type) {
	case error:
		err = e
	default:
		err = fmt.Errorf("%v", e)
	}

	stack := make([]uintptr, MaxStackDepth)
	length := runtime.Callers(2, stack[:])
	return &Error{
		Err:   err,
		stack: stack[:length],
	}
}
func New(e interface{}) *Error {
	var err error

	switch e := e.(type) {
	case error:
		err = e
	default:
		err = fmt.Errorf("%v", e)
	}

	stack := make([]uintptr, MaxStackDepth)
	length := runtime.Callers(2, stack[:])
	return &Error{
		Err:   err,
		stack: stack[:length],
	}
}
func New ( e interface { } ) * Error { var err error switch e := e . ( type ) { case error : err = e default : err = fmt . Errorf ( " " , e ) } stack := make ( [ ] uintptr , MaxStackDepth ) length := runtime . Callers ( 2 , stack [ : ] ) return & Error { Err : err , stack : stack [ : length ] , } }
// New makes an Error from the given value. If that value is already an
// error then it will be used directly, if not, it will be passed to
// fmt.Errorf("%v"). The stacktrace will point to the line of code that
// called New.
New makes an Error from the given value . If that value is already an error then it will be used directly if not it will be passed to fmt . Errorf ( %v ) . The stacktrace will point to the line of code that called New .