diff options
| author | Jeff Carr <[email protected]> | 2025-10-22 09:19:26 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-22 09:19:26 -0500 |
| commit | 23b2d19bc03b4db253b15cc6fef7176ab31d4f18 (patch) | |
| tree | 275cb2d3fc92cb5af997582c715f4619eb1d68d2 /panic.go | |
| parent | 820fa4b7e71690accbd17063894032140bd9c4b6 (diff) | |
finally can fix the Load() and Save() names
Diffstat (limited to 'panic.go')
| -rw-r--r-- | panic.go | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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 } |
