summaryrefslogtreecommitdiff
path: root/panic.go
diff options
context:
space:
mode:
Diffstat (limited to 'panic.go')
-rw-r--r--panic.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/panic.go b/panic.go
new file mode 100644
index 0000000..8ed4df7
--- /dev/null
+++ b/panic.go
@@ -0,0 +1,15 @@
+package config
+
+import "google.golang.org/protobuf/proto"
+
+// should this be a function?
+func LoadPanicPB(pb proto.Message) error {
+ fullname, err := GetFilename(pb)
+ if err != nil {
+ panic("config.LoadPB() err")
+ }
+ if fullname == "" {
+ panic("config.LoadPB() got blank filename = ''")
+ }
+ return LoadPB(pb)
+}