summaryrefslogtreecommitdiff
path: root/parse_fastimport.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-30 20:41:00 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-30 20:41:00 -0500
commite3b3c08e62f07c75426536c3407dfebc4b71405a (patch)
tree9add249423816b9bc93f40694d921330243d6725 /parse_fastimport.go
parentdeb826c9c18f26652e565a013e2d00929c0b8a35 (diff)
use github.com/pkg/errors
Diffstat (limited to 'parse_fastimport.go')
-rw-r--r--parse_fastimport.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse_fastimport.go b/parse_fastimport.go
index 80488de..14080b6 100644
--- a/parse_fastimport.go
+++ b/parse_fastimport.go
@@ -1,10 +1,10 @@
package libfastimport
import (
- "fmt"
"strings"
"git.lukeshu.com/go/libfastimport/textproto"
+ "github.com/pkg/errors"
)
var parser_regularCmds = make(map[string]Cmd)
@@ -17,7 +17,7 @@ func parser_registerCmd(prefix string, cmd Cmd) {
case cmdClassComment:
parser_commentCmds[prefix] = cmd
default:
- panic(fmt.Errorf("invalid cmdClass: %d", cmd.fiCmdClass()))
+ panic(errors.Errorf("invalid cmdClass: %d", cmd.fiCmdClass()))
}
}
@@ -121,12 +121,12 @@ func (p *parser) parse() error {
_, p.inCommit = cmd.(CmdCommit)
case cmdClassCommit:
if !p.inCommit {
- return fmt.Errorf("Got in-commit-only command outside of a commit: %[1]T(%#[1]v)", cmd)
+ return errors.Errorf("Got in-commit-only command outside of a commit: %[1]T(%#[1]v)", cmd)
}
case cmdClassComment:
/* do nothing */
default:
- panic(fmt.Errorf("invalid cmdClass: %d", cmd.fiCmdClass()))
+ panic(errors.Errorf("invalid cmdClass: %d", cmd.fiCmdClass()))
}
p.ret_cmd <- cmd