From 87888eaab1caa52b6b073f610508e0f65b4141f6 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Wed, 19 Jul 2017 12:59:16 +0200 Subject: storage/filesystem: check all Close errors --- storage/filesystem/shallow.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'storage/filesystem/shallow.go') diff --git a/storage/filesystem/shallow.go b/storage/filesystem/shallow.go index 107818c..394e6ed 100644 --- a/storage/filesystem/shallow.go +++ b/storage/filesystem/shallow.go @@ -6,6 +6,7 @@ import ( "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit" + "gopkg.in/src-d/go-git.v4/utils/ioutil" ) // ShallowStorage where the shallow commits are stored, an internal to @@ -23,14 +24,14 @@ func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error { return err } - defer f.Close() + defer ioutil.CheckClose(f, &err) for _, h := range commits { if _, err := fmt.Fprintf(f, "%s\n", h); err != err { return err } } - return nil + return err } // Shallow return the shallow commits reading from shallo file from .git -- cgit