aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/config.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-06 01:56:41 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-06 01:56:41 +0200
commitae2b10d50da5455b382ab9d543be4fe859afe9e0 (patch)
tree58cf3247a7283769c77df945f1be9a5d70e65a69 /storage/filesystem/config.go
parent0b7aa259fe3da2236952843fe46db62bdee395eb (diff)
downloadgo-git-ae2b10d50da5455b382ab9d543be4fe859afe9e0.tar.gz
storage: filesystem idx generation (wip)
Diffstat (limited to 'storage/filesystem/config.go')
-rw-r--r--storage/filesystem/config.go11
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 {