1
0
mirror of https://github.com/Elegycloud/clash-backup.git synced 2024-12-22 20:17:24 +08:00
clash/observable/iterable.go
2023-11-11 16:07:53 +08:00

19 lines
318 B
Go

package observable
import (
"errors"
)
type Iterable <-chan interface{}
func NewIterable(any interface{}) (Iterable, error) {
switch any := any.(type) {
case chan interface{}:
return Iterable(any), nil
case <-chan interface{}:
return Iterable(any), nil
default:
return nil, errors.New("type error")
}
}