push
travis-ci
3342 of 3342 new or added lines in 18 files covered. (100.0%)
2772 of 3342 relevant lines covered (82.94%)
1857.95 hits per line
1 |
package rxgo
|
|
2 |
|
|
3 |
type rangeIterable struct { |
|
4 |
start, count int
|
|
5 |
opts []Option |
|
6 |
} |
|
7 |
|
|
|
func newRangeIterable(start, count int, opts ...Option) Iterable { |
21✔ |
|
return &rangeIterable{
|
21✔ |
|
start: start, |
21✔ |
|
count: count, |
21✔ |
|
opts: opts, |
21✔ |
|
} |
21✔ |
|
} |
21✔ |
15 |
|
|
|
func (i *rangeIterable) Observe(opts ...Option) <-chan Item { |
28✔ |
|
option := parseOptions(append(i.opts, opts...)...)
|
28✔ |
|
ctx := option.buildContext() |
28✔ |
|
next := option.buildChannel() |
28✔ |
|
|
28✔ |
|
go func() { |
56✔ |
|
for idx := i.start; idx <= i.start+i.count; idx++ {
|
160,095✔ |
|
select {
|
160,067✔ |
|
case <-ctx.Done():
|
× |
|
return
|
× |
|
case next <- Of(idx):
|
160,065✔ |
27 |
} |
|
28 |
} |
|
|
close(next)
|
26✔ |
30 |
}() |
|
|
return next
|
28✔ |
32 |
} |