aboutsummaryrefslogtreecommitdiff
path: root/misc.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc.go')
-rw-r--r--misc.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/misc.go b/misc.go
index 73e3b07..70e5a4f 100644
--- a/misc.go
+++ b/misc.go
@@ -25,12 +25,19 @@ import (
"encoding/base64"
)
-func e(e error) {
- if e != nil {
- panic(e)
+func e(err error) {
+ if err != nil {
+ panic(err)
}
}
+func er[v_t any](v v_t, err error) v_t {
+ if err != nil {
+ panic(err)
+ }
+ return v
+}
+
/*
* Generate a random url-safe string.
* Note that the "len" parameter specifies the number of bytes taken from the