diff options
Diffstat (limited to 'storage/filesystem/config.go')
-rw-r--r-- | storage/filesystem/config.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/storage/filesystem/config.go b/storage/filesystem/config.go index c83a59e..c91ba58 100644 --- a/storage/filesystem/config.go +++ b/storage/filesystem/config.go @@ -52,18 +52,15 @@ func (c *ConfigStorage) DeleteRemote(name string) error { } func (c *ConfigStorage) read() (*ConfigFile, error) { - fs, path, err := c.dir.Config() + f, err := c.dir.Config() if err != nil { return nil, err } - r, err := fs.Open(path) - if err != nil { - return nil, err - } + defer f.Close() - f := &ConfigFile{} - return f, f.Decode(r) + config := &ConfigFile{} + return config, config.Decode(f) } type ConfigFile struct { |