summaryrefslogtreecommitdiff
path: root/panic.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-22 09:19:26 -0500
committerJeff Carr <[email protected]>2025-10-22 09:19:26 -0500
commit23b2d19bc03b4db253b15cc6fef7176ab31d4f18 (patch)
tree275cb2d3fc92cb5af997582c715f4619eb1d68d2 /panic.go
parent820fa4b7e71690accbd17063894032140bd9c4b6 (diff)
finally can fix the Load() and Save() names
Diffstat (limited to 'panic.go')
-rw-r--r--panic.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/panic.go b/panic.go
index 8ed4df7..efab850 100644
--- a/panic.go
+++ b/panic.go
@@ -1,15 +1,24 @@
package config
-import "google.golang.org/protobuf/proto"
+import (
+ "fmt"
+
+ "google.golang.org/protobuf/proto"
+)
// should this be a function?
-func LoadPanicPB(pb proto.Message) error {
+func LoadPanic(pb proto.Message) error {
fullname, err := GetFilename(pb)
if err != nil {
- panic("config.LoadPB() err")
+ panic("config.LoadPanic() pb doesn't have pb.Filename")
}
if fullname == "" {
- panic("config.LoadPB() got blank filename = ''")
+ panic("config.LoadPanic() got blank filename = ''")
+ }
+ err = ReLoad(pb)
+ if err != nil {
+ panic(fmt.Sprintf("config.LoadPanic() err (%v)", err))
}
- return LoadPB(pb)
+
+ return nil
}