mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
split webrtc & WS destroy.
This commit is contained in:
22
internal/utils/errors.go
Normal file
22
internal/utils/errors.go
Normal file
@ -0,0 +1,22 @@
|
||||
package utils
|
||||
|
||||
import "fmt"
|
||||
|
||||
func ErrorsJoin(errs []error) error {
|
||||
var resErr error
|
||||
|
||||
for _, err := range errs {
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if resErr == nil {
|
||||
resErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
resErr = fmt.Errorf("%w; %s", resErr, err.Error())
|
||||
}
|
||||
|
||||
return resErr
|
||||
}
|
Reference in New Issue
Block a user