aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-05-15 20:22:28 +0100
committerGitHub <noreply@github.com>2023-05-15 20:22:28 +0100
commit4ff2213cc5422d3300cf9828ea0781820888d32d (patch)
tree9226bdd5f898f0813126e6df5f99ddf2bfec08c5 /storage
parentdc2b346ed149080199d578f0190f3ac1156480c2 (diff)
parentbddd89e697ebdaad2fe341b3e8a3233691f5544a (diff)
downloadgo-git-4ff2213cc5422d3300cf9828ea0781820888d32d.tar.gz
Merge pull request #770 from pjbgf/small-fixes
*: Small fixes across the codebase
Diffstat (limited to 'storage')
-rw-r--r--storage/filesystem/dotgit/dotgit.go3
-rw-r--r--storage/filesystem/dotgit/dotgit_test.go7
-rw-r--r--storage/filesystem/object_test.go3
-rw-r--r--storage/test/storage_suite.go5
4 files changed, 7 insertions, 11 deletions
diff --git a/storage/filesystem/dotgit/dotgit.go b/storage/filesystem/dotgit/dotgit.go
index 5bde37f..19d7026 100644
--- a/storage/filesystem/dotgit/dotgit.go
+++ b/storage/filesystem/dotgit/dotgit.go
@@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"io"
- stdioutil "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -647,7 +646,7 @@ func (d *DotGit) ObjectDelete(h plumbing.Hash) error {
}
func (d *DotGit) readReferenceFrom(rd io.Reader, name string) (ref *plumbing.Reference, err error) {
- b, err := stdioutil.ReadAll(rd)
+ b, err := io.ReadAll(rd)
if err != nil {
return nil, err
}
diff --git a/storage/filesystem/dotgit/dotgit_test.go b/storage/filesystem/dotgit/dotgit_test.go
index 63c9eb0..6a339d1 100644
--- a/storage/filesystem/dotgit/dotgit_test.go
+++ b/storage/filesystem/dotgit/dotgit_test.go
@@ -4,7 +4,6 @@ import (
"bufio"
"encoding/hex"
"io"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -374,7 +373,7 @@ func (s *SuiteDotGit) TestConfigWriteAndConfig(c *C) {
f, err = dir.Config()
c.Assert(err, IsNil)
- cnt, err := ioutil.ReadAll(f)
+ cnt, err := io.ReadAll(f)
c.Assert(err, IsNil)
c.Assert(string(cnt), Equals, "foo")
@@ -404,7 +403,7 @@ func (s *SuiteDotGit) TestIndexWriteAndIndex(c *C) {
f, err = dir.Index()
c.Assert(err, IsNil)
- cnt, err := ioutil.ReadAll(f)
+ cnt, err := io.ReadAll(f)
c.Assert(err, IsNil)
c.Assert(string(cnt), Equals, "foo")
@@ -434,7 +433,7 @@ func (s *SuiteDotGit) TestShallowWriteAndShallow(c *C) {
f, err = dir.Shallow()
c.Assert(err, IsNil)
- cnt, err := ioutil.ReadAll(f)
+ cnt, err := io.ReadAll(f)
c.Assert(err, IsNil)
c.Assert(string(cnt), Equals, "foo")
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go
index b5f137f..251077a 100644
--- a/storage/filesystem/object_test.go
+++ b/storage/filesystem/object_test.go
@@ -4,7 +4,6 @@ import (
"encoding/hex"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"testing"
@@ -510,7 +509,7 @@ func BenchmarkPackfileIterReadContent(b *testing.B) {
b.Fatal(err)
}
- if _, err := ioutil.ReadAll(r); err != nil {
+ if _, err := io.ReadAll(r); err != nil {
b.Fatal(err)
}
diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go
index 2c00e75..ee67fc7 100644
--- a/storage/test/storage_suite.go
+++ b/storage/test/storage_suite.go
@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing"
@@ -502,12 +501,12 @@ func objectEquals(a plumbing.EncodedObject, b plumbing.EncodedObject) error {
return fmt.Errorf("can't get reader on b: %q", err)
}
- ca, err := ioutil.ReadAll(ra)
+ ca, err := io.ReadAll(ra)
if err != nil {
return fmt.Errorf("error reading a: %q", err)
}
- cb, err := ioutil.ReadAll(rb)
+ cb, err := io.ReadAll(rb)
if err != nil {
return fmt.Errorf("error reading b: %q", err)
}