aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/change_adaptor.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-04-26 13:26:51 +0200
committerSantiago M. Mola <santi@mola.io>2017-04-26 13:41:46 +0200
commit45ac03181f61477d28e031725c68f938cb379554 (patch)
treee1a636db10a31df84dd05fb312586a77b860dd79 /plumbing/object/change_adaptor.go
parent9e4f992d9633dd1ac8cc0b5bcd92b377190a9a03 (diff)
downloadgo-git-45ac03181f61477d28e031725c68f938cb379554.tar.gz
fix format string issues as found by go vet
Diffstat (limited to 'plumbing/object/change_adaptor.go')
-rw-r--r--plumbing/object/change_adaptor.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/plumbing/object/change_adaptor.go b/plumbing/object/change_adaptor.go
index cf8de6c..49b6545 100644
--- a/plumbing/object/change_adaptor.go
+++ b/plumbing/object/change_adaptor.go
@@ -1,6 +1,7 @@
package object
import (
+ "errors"
"fmt"
"gopkg.in/src-d/go-git.v4/utils/merkletrie"
@@ -15,11 +16,11 @@ func newChange(c merkletrie.Change) (*Change, error) {
var err error
if ret.From, err = newChangeEntry(c.From); err != nil {
- return nil, fmt.Errorf("From field: ", err)
+ return nil, fmt.Errorf("From field: %s", err)
}
if ret.To, err = newChangeEntry(c.To); err != nil {
- return nil, fmt.Errorf("To field: ", err)
+ return nil, fmt.Errorf("To field: %s", err)
}
return ret, nil
@@ -32,7 +33,7 @@ func newChangeEntry(p noder.Path) (ChangeEntry, error) {
asTreeNoder, ok := p.Last().(*treeNoder)
if !ok {
- return ChangeEntry{}, fmt.Errorf("cannot transform non-TreeNoders")
+ return ChangeEntry{}, errors.New("cannot transform non-TreeNoders")
}
return ChangeEntry{
@@ -52,7 +53,7 @@ func newChanges(src merkletrie.Changes) (Changes, error) {
for i, e := range src {
ret[i], err = newChange(e)
if err != nil {
- return nil, fmt.Errorf("change #%d: %s", err)
+ return nil, fmt.Errorf("change #%d: %s", i, err)
}
}