Init: first commit 🎉
This commit is contained in:
15
observable/util.go
Normal file
15
observable/util.go
Normal file
@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user