From e3b3c08e62f07c75426536c3407dfebc4b71405a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 30 Nov 2017 20:41:00 -0500 Subject: use github.com/pkg/errors --- cmd_commit.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd_commit.go') diff --git a/cmd_commit.go b/cmd_commit.go index 3c2a46e..db22642 100644 --- a/cmd_commit.go +++ b/cmd_commit.go @@ -1,9 +1,10 @@ package libfastimport import ( - "fmt" "strconv" "strings" + + "github.com/pkg/errors" ) // M /////////////////////////////////////////////////////////////////////////// @@ -28,7 +29,7 @@ func (FileModify) fiCmdRead(fir fiReader) (cmd Cmd, err error) { str := trimLinePrefix(line, "M ") fields := strings.SplitN(str, " ", 3) if len(fields) != 3 { - return nil, fmt.Errorf("commit: malformed modify command: %v", line) + return nil, errors.Errorf("commit: malformed modify command: %v", line) } nMode, err := strconv.ParseUint(fields[0], 8, 18) @@ -168,7 +169,7 @@ func (NoteModify) fiCmdRead(fir fiReader) (cmd Cmd, err error) { str := trimLinePrefix(line, "N ") sp := strings.IndexByte(str, ' ') if sp < 0 { - return nil, fmt.Errorf("commit: malformed notemodify command: %v", line) + return nil, errors.Errorf("commit: malformed notemodify command: %v", line) } ref := str[:sp] -- cgit v1.2.3-54-g00ecf