diff options
author | Santiago M. Mola <santi@mola.io> | 2017-07-19 12:59:16 +0200 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-07-19 14:48:46 +0200 |
commit | 87888eaab1caa52b6b073f610508e0f65b4141f6 (patch) | |
tree | 1ddaa824f7baa26350aa50607877d4bf9e207f13 /storage/filesystem/internal | |
parent | ebc25df06ce7d11afe88339af7bb097926599b7d (diff) | |
download | go-git-87888eaab1caa52b6b073f610508e0f65b4141f6.tar.gz |
storage/filesystem: check all Close errors
Diffstat (limited to 'storage/filesystem/internal')
-rw-r--r-- | storage/filesystem/internal/dotgit/dotgit.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go index f3a2308..9bbf4e8 100644 --- a/storage/filesystem/internal/dotgit/dotgit.go +++ b/storage/filesystem/internal/dotgit/dotgit.go @@ -253,10 +253,10 @@ func (d *DotGit) SetRef(r *plumbing.Reference) error { return err } - if _, err := f.Write([]byte(content)); err != nil { - return err - } - return f.Close() + defer ioutil.CheckClose(f, &err) + + _, err = f.Write([]byte(content)) + return err } // Refs scans the git directory collecting references, which it returns. |