darjun/go-daily-lib

输出错误

Closed this issue · 1 comments

blog:https://darjun.github.io/2020/10/11/godailylib/rxgo/
博客里讲到:

func main() {
  observable := rxgo.Just(1, 2, 3, 4, 5)()
  <-observable.ForEach(func(v interface{}) {
    fmt.Println("received:", v)
  }, func(err error) {
    fmt.Println("error:", err)
  }, func() {
    fmt.Println("completed")
  })
}

输出是:

$ go run main.go 
received: 1
received: 2
received: 3
received: 4
received: 5
completed

实测应该是:

$ go run main.go 
1
2
error: unknown
3
4
5

你写的代码能分享出来么,我刚刚又跑了一次,我的输出还是上面的那个。
image