From 27a034c7643768a4ad486a64e8a1b59fa3f8b3b4 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Wed, 1 Jul 2020 20:51:24 +0200 Subject: fix goreportcard warnings --- plumbing/format/index/decoder.go | 4 +++- plumbing/format/index/encoder_test.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'plumbing/format/index') diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go index 79d0b9e..d341d59 100644 --- a/plumbing/format/index/decoder.go +++ b/plumbing/format/index/decoder.go @@ -390,7 +390,9 @@ func (d *treeExtensionDecoder) readEntry() (*TreeEntry, error) { e.Trees = i _, err = io.ReadFull(d.r, e.Hash[:]) - + if err != nil { + return nil, err + } return e, nil } diff --git a/plumbing/format/index/encoder_test.go b/plumbing/format/index/encoder_test.go index 17585a0..b7a73cb 100644 --- a/plumbing/format/index/encoder_test.go +++ b/plumbing/format/index/encoder_test.go @@ -5,9 +5,10 @@ import ( "strings" "time" + "github.com/go-git/go-git/v5/plumbing" + "github.com/google/go-cmp/cmp" . "gopkg.in/check.v1" - "github.com/go-git/go-git/v5/plumbing" ) func (s *IndexSuite) TestEncode(c *C) { -- cgit From f9cf9a99fd51bff8e002900a3a73d117ba54c887 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Wed, 1 Jul 2020 21:03:12 +0200 Subject: fix nil --- plumbing/format/index/decoder_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/format/index') diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go index 4e47dde..39ab336 100644 --- a/plumbing/format/index/decoder_test.go +++ b/plumbing/format/index/decoder_test.go @@ -6,8 +6,8 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/filemode" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "github.com/go-git/go-git-fixtures/v4" ) func Test(t *testing.T) { TestingT(t) } -- cgit