diff options
Diffstat (limited to 'vendor/github.com/go-errors/errors')
-rw-r--r-- | vendor/github.com/go-errors/errors/README.md | 1 | ||||
-rw-r--r-- | vendor/github.com/go-errors/errors/stackframe.go | 14 |
2 files changed, 3 insertions, 12 deletions
diff --git a/vendor/github.com/go-errors/errors/README.md b/vendor/github.com/go-errors/errors/README.md index 3d7852594..2ee13f117 100644 --- a/vendor/github.com/go-errors/errors/README.md +++ b/vendor/github.com/go-errors/errors/README.md @@ -79,4 +79,3 @@ This package is licensed under the MIT license, see LICENSE.MIT for details. > ``` * v1.4.0 *BREAKING* v1.4.0 reverted all changes from v1.3.0 and is identical to v1.2.0 * v1.4.1 no code change, but now without an unnecessary cover.out file. -* v1.4.2 performance improvement to ErrorStack() to avoid unnecessary work https://github.com/go-errors/errors/pull/40 diff --git a/vendor/github.com/go-errors/errors/stackframe.go b/vendor/github.com/go-errors/errors/stackframe.go index ef4a8b3f3..f420849d2 100644 --- a/vendor/github.com/go-errors/errors/stackframe.go +++ b/vendor/github.com/go-errors/errors/stackframe.go @@ -53,7 +53,7 @@ func (frame *StackFrame) Func() *runtime.Func { func (frame *StackFrame) String() string { str := fmt.Sprintf("%s:%d (0x%x)\n", frame.File, frame.LineNumber, frame.ProgramCounter) - source, err := frame.sourceLine() + source, err := frame.SourceLine() if err != nil { return str } @@ -63,21 +63,13 @@ func (frame *StackFrame) String() string { // SourceLine gets the line of code (from File and Line) of the original source if possible. func (frame *StackFrame) SourceLine() (string, error) { - source, err := frame.sourceLine() - if err != nil { - return source, New(err) - } - return source, err -} - -func (frame *StackFrame) sourceLine() (string, error) { if frame.LineNumber <= 0 { return "???", nil } file, err := os.Open(frame.File) if err != nil { - return "", err + return "", New(err) } defer file.Close() @@ -90,7 +82,7 @@ func (frame *StackFrame) sourceLine() (string, error) { currentLine++ } if err := scanner.Err(); err != nil { - return "", err + return "", New(err) } return "???", nil |