Added Must func to other
This commit is contained in:
parent
8b839f802b
commit
94e1712122
1 changed files with 7 additions and 0 deletions
|
@ -6,3 +6,10 @@ package other
|
||||||
func OutputIntoChannel[T any](out T, target chan T) {
|
func OutputIntoChannel[T any](out T, target chan T) {
|
||||||
target <- out
|
target <- out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Must[T any](val T, err error) T {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue