aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/index.go
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2018-03-26 23:18:54 +0200
committerJavi Fontan <jfontan@gmail.com>2018-03-27 17:32:59 +0200
commit05c414a169a75ca933402e5be19a5c4304aa4f00 (patch)
tree19dcd85c5d221cf41fa06c200423d5cc236f9f31 /storage/filesystem/index.go
parent160e6d5b654fbbaf0d9264f226c56a03f0e27d30 (diff)
downloadgo-git-05c414a169a75ca933402e5be19a5c4304aa4f00.tar.gz
*: Use CheckClose with named returns
Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'storage/filesystem/index.go')
-rw-r--r--storage/filesystem/index.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/filesystem/index.go b/storage/filesystem/index.go
index 14ab09a..092edec 100644
--- a/storage/filesystem/index.go
+++ b/storage/filesystem/index.go
@@ -12,7 +12,7 @@ type IndexStorage struct {
dir *dotgit.DotGit
}
-func (s *IndexStorage) SetIndex(idx *index.Index) error {
+func (s *IndexStorage) SetIndex(idx *index.Index) (err error) {
f, err := s.dir.IndexWriter()
if err != nil {
return err
@@ -25,7 +25,7 @@ func (s *IndexStorage) SetIndex(idx *index.Index) error {
return err
}
-func (s *IndexStorage) Index() (*index.Index, error) {
+func (s *IndexStorage) Index() (i *index.Index, err error) {
idx := &index.Index{
Version: 2,
}