summaryrefslogtreecommitdiff
path: root/load.go
diff options
context:
space:
mode:
Diffstat (limited to 'load.go')
-rw-r--r--load.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/load.go b/load.go
index 5373025..87831fc 100644
--- a/load.go
+++ b/load.go
@@ -34,9 +34,11 @@ func ConfigLoad(pb proto.Message, argname string, protoname string) error {
}
fullname = filepath.Join(homeDir, ".config", argname, protoname+".text")
+
if data, err = loadFile(fullname); err != nil {
log.Warn("config file failed to load", err)
- // something went wrong loading the file
+ // set pb.Filename that was attempted
+ SetFilename(pb, fullname)
return err
}
@@ -50,9 +52,6 @@ func ConfigLoad(pb proto.Message, argname string, protoname string) error {
return err
}
- // set pb.Filename if it is there in the .proto file
- SetFilename(pb, fullname)
-
log.Infof("ConfigLoad() arg=%s, proto=%s\n", argname, protoname)
return nil
}