This commit is contained in:
12
pkg/flowutils/flowutils.go
Normal file
12
pkg/flowutils/flowutils.go
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package flowutils
|
||||||
|
|
||||||
|
func PanicIf(err error) {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func Must[T any](val T, err error) T {
|
||||||
|
PanicIf(err)
|
||||||
|
return val
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user