Moved stuff, added Contains to sliceutils
This commit is contained in:
parent
94e1712122
commit
ae2da5efa5
10 changed files with 21 additions and 43 deletions
15
other/other.go
Normal file
15
other/other.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package other
|
||||
|
||||
// OutputIntoChannel takes a singular return value and sends it into the target channel.
|
||||
// This is a wrapper for functions where a value can't be collected from directly.
|
||||
// Example: goroutines
|
||||
func OutputIntoChannel[T any](out T, target chan T) {
|
||||
target <- out
|
||||
}
|
||||
|
||||
func Must[T any](val T, err error) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return val
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue