mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-28 00:17:23 +02:00
split webrtc & WS destroy.
This commit is contained in:
parent
a8e44160dc
commit
78b6264494
5 changed files with 57 additions and 33 deletions
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue