diff options
Diffstat (limited to '')
-rw-r--r-- | misc.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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 |