aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r--storage/filesystem/object.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go
index 9f1c5ef..26190fd 100644
--- a/storage/filesystem/object.go
+++ b/storage/filesystem/object.go
@@ -55,7 +55,7 @@ func (s *ObjectStorage) requireIndex() error {
return nil
}
-func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) error {
+func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) (err error) {
f, err := s.dir.ObjectPackIdx(h)
if err != nil {
return err
@@ -94,7 +94,7 @@ func (s *ObjectStorage) PackfileWriter() (io.WriteCloser, error) {
}
// SetEncodedObject adds a new object to the storage.
-func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (plumbing.Hash, error) {
+func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (h plumbing.Hash, err error) {
if o.Type() == plumbing.OFSDeltaObject || o.Type() == plumbing.REFDeltaObject {
return plumbing.ZeroHash, plumbing.ErrInvalidType
}
@@ -113,11 +113,11 @@ func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (plumbing.Has
defer ioutil.CheckClose(or, &err)
- if err := ow.WriteHeader(o.Type(), o.Size()); err != nil {
+ if err = ow.WriteHeader(o.Type(), o.Size()); err != nil {
return plumbing.ZeroHash, err
}
- if _, err := io.Copy(ow, or); err != nil {
+ if _, err = io.Copy(ow, or); err != nil {
return plumbing.ZeroHash, err
}