diff options
Diffstat (limited to 'storage/filesystem/config.go')
-rw-r--r-- | storage/filesystem/config.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/storage/filesystem/config.go b/storage/filesystem/config.go index cad698a..a2cc173 100644 --- a/storage/filesystem/config.go +++ b/storage/filesystem/config.go @@ -1,11 +1,12 @@ package filesystem import ( - "io/ioutil" + stdioutil "io/ioutil" "os" "gopkg.in/src-d/go-git.v4/config" "gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit" + "gopkg.in/src-d/go-git.v4/utils/ioutil" ) type ConfigStorage struct { @@ -24,9 +25,9 @@ func (c *ConfigStorage) Config() (*config.Config, error) { return nil, err } - defer f.Close() + defer ioutil.CheckClose(f, &err) - b, err := ioutil.ReadAll(f) + b, err := stdioutil.ReadAll(f) if err != nil { return nil, err } @@ -35,7 +36,7 @@ func (c *ConfigStorage) Config() (*config.Config, error) { return nil, err } - return cfg, nil + return cfg, err } func (c *ConfigStorage) SetConfig(cfg *config.Config) error { @@ -48,7 +49,7 @@ func (c *ConfigStorage) SetConfig(cfg *config.Config) error { return err } - defer f.Close() + defer ioutil.CheckClose(f, &err) b, err := cfg.Marshal() if err != nil { |