11 lines
181 B
Go
11 lines
181 B
Go
|
package omadaapi
|
||
|
|
||
|
func PanicOnError[T any](valueChan <-chan T, errChan <-chan error) <-chan T {
|
||
|
go func() {
|
||
|
for err := range errChan {
|
||
|
panic(err)
|
||
|
}
|
||
|
}()
|
||
|
return valueChan
|
||
|
}
|