aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/updreq_decode_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-05-11 21:59:37 +0100
committerPaulo Gomes <pjbgf@linux.com>2023-05-11 21:59:37 +0100
commit096b3cc16b547f3c0d6e4f92046945bcfac0fa14 (patch)
treedf3e5f5265aac52a6683be10d74561e26e70cb0c /plumbing/protocol/packp/updreq_decode_test.go
parent9dfaf6acd8e3aa1c85bcce7d45f8e8c6b908319c (diff)
downloadgo-git-096b3cc16b547f3c0d6e4f92046945bcfac0fa14.tar.gz
*: Remove use of deprecated io/util
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'plumbing/protocol/packp/updreq_decode_test.go')
-rw-r--r--plumbing/protocol/packp/updreq_decode_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/plumbing/protocol/packp/updreq_decode_test.go b/plumbing/protocol/packp/updreq_decode_test.go
index 2630112..bdcbdf5 100644
--- a/plumbing/protocol/packp/updreq_decode_test.go
+++ b/plumbing/protocol/packp/updreq_decode_test.go
@@ -3,7 +3,6 @@ package packp
import (
"bytes"
"io"
- "io/ioutil"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/format/pktline"
@@ -157,7 +156,7 @@ func (s *UpdReqDecodeSuite) TestOneUpdateCommand(c *C) {
expected.Commands = []*Command{
{Name: name, Old: hash1, New: hash2},
}
- expected.Packfile = ioutil.NopCloser(bytes.NewReader([]byte{}))
+ expected.Packfile = io.NopCloser(bytes.NewReader([]byte{}))
payloads := []string{
"1ecf0ef2c2dffb796033e5a02219af86ec6584e5 2ecf0ef2c2dffb796033e5a02219af86ec6584e5 myref\x00",
@@ -177,7 +176,7 @@ func (s *UpdReqDecodeSuite) TestMultipleCommands(c *C) {
{Name: plumbing.ReferenceName("myref2"), Old: plumbing.ZeroHash, New: hash2},
{Name: plumbing.ReferenceName("myref3"), Old: hash1, New: plumbing.ZeroHash},
}
- expected.Packfile = ioutil.NopCloser(bytes.NewReader([]byte{}))
+ expected.Packfile = io.NopCloser(bytes.NewReader([]byte{}))
payloads := []string{
"1ecf0ef2c2dffb796033e5a02219af86ec6584e5 2ecf0ef2c2dffb796033e5a02219af86ec6584e5 myref1\x00",
@@ -200,7 +199,7 @@ func (s *UpdReqDecodeSuite) TestMultipleCommandsAndCapabilities(c *C) {
{Name: plumbing.ReferenceName("myref3"), Old: hash1, New: plumbing.ZeroHash},
}
expected.Capabilities.Add("shallow")
- expected.Packfile = ioutil.NopCloser(bytes.NewReader([]byte{}))
+ expected.Packfile = io.NopCloser(bytes.NewReader([]byte{}))
payloads := []string{
"1ecf0ef2c2dffb796033e5a02219af86ec6584e5 2ecf0ef2c2dffb796033e5a02219af86ec6584e5 myref1\x00shallow",
@@ -224,7 +223,7 @@ func (s *UpdReqDecodeSuite) TestMultipleCommandsAndCapabilitiesShallow(c *C) {
}
expected.Capabilities.Add("shallow")
expected.Shallow = &hash1
- expected.Packfile = ioutil.NopCloser(bytes.NewReader([]byte{}))
+ expected.Packfile = io.NopCloser(bytes.NewReader([]byte{}))
payloads := []string{
"shallow 1ecf0ef2c2dffb796033e5a02219af86ec6584e5",
@@ -247,7 +246,7 @@ func (s *UpdReqDecodeSuite) TestWithPackfile(c *C) {
{Name: name, Old: hash1, New: hash2},
}
packfileContent := []byte("PACKabc")
- expected.Packfile = ioutil.NopCloser(bytes.NewReader(packfileContent))
+ expected.Packfile = io.NopCloser(bytes.NewReader(packfileContent))
payloads := []string{
"1ecf0ef2c2dffb796033e5a02219af86ec6584e5 2ecf0ef2c2dffb796033e5a02219af86ec6584e5 myref\x00",
@@ -298,10 +297,10 @@ func (s *UpdReqDecodeSuite) testDecodeOkExpected(c *C, expected *ReferenceUpdate
}
func (s *UpdReqDecodeSuite) compareReaders(c *C, a io.ReadCloser, b io.ReadCloser) {
- pba, err := ioutil.ReadAll(a)
+ pba, err := io.ReadAll(a)
c.Assert(err, IsNil)
c.Assert(a.Close(), IsNil)
- pbb, err := ioutil.ReadAll(b)
+ pbb, err := io.ReadAll(b)
c.Assert(err, IsNil)
c.Assert(b.Close(), IsNil)
c.Assert(pba, DeepEquals, pbb)