summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-02-21 17:32:36 +0100
committerRuben Pollan <meskio@sindominio.net>2018-02-21 17:32:36 +0100
commitddecca33cd9ddb5b1d2f447849fdd57350c786e9 (patch)
treedfca2e9297fae16981c56b099d41a3a0b6a02094 /config.go
parent2b20971115e0c789c9e387042fc23b5b60f5af56 (diff)
[bug] ignore config parsing errors
Diffstat (limited to 'config.go')
-rw-r--r--config.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/config.go b/config.go
index d751a7b..cf3ae1e 100644
--- a/config.go
+++ b/config.go
@@ -40,22 +40,19 @@ type systrayConfig struct {
SelectWateway bool
}
-func parseConfig() (*systrayConfig, error) {
+func parseConfig() *systrayConfig {
var conf systrayConfig
f, err := os.Open(configPath)
- if os.IsNotExist(err) {
- return &conf, nil
- }
if err != nil {
- return nil, err
+ return &conf
}
defer f.Close()
dec := json.NewDecoder(f)
err = dec.Decode(&conf)
conf.parseFlags()
- return &conf, err
+ return &conf
}
func (c *systrayConfig) parseFlags() {