diff options
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/format/pktline/scanner_test.go | 2 | ||||
-rw-r--r-- | plumbing/object/change_adaptor.go | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plumbing/format/pktline/scanner_test.go b/plumbing/format/pktline/scanner_test.go index b8a78ec..048ea38 100644 --- a/plumbing/format/pktline/scanner_test.go +++ b/plumbing/format/pktline/scanner_test.go @@ -218,7 +218,7 @@ func ExampleScanner() { for s.Scan() { payload := s.Bytes() if len(payload) == 0 { // zero sized payloads correspond to flush-pkts. - fmt.Println("FLUSH-PKT DETECTED\n") + fmt.Println("FLUSH-PKT DETECTED") } else { // otherwise, you will be able to access the full payload. fmt.Printf("PAYLOAD = %q\n", string(payload)) } 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) } } |