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

16 lines
257 B
Go

package observable
func mergeWithBytes(ch <-chan interface{}, buf []byte) chan interface{} {
out := make(chan interface{})
go func() {
defer close(out)
if len(buf) != 0 {
out <- buf
}
for elm := range ch {
out <- elm
}
}()
return out
}