8. Generators vs Pipeline
• generators create values when you ask for them
• pipeline produce values before you ask for them
• https://play.golang.org/p/R_XHMu1jBz
13. Close source & drain downstream
• source closing trickles down to consumers
• all goroutines can exit
• https://play.golang.org/p/pRpNspMG2z
14. Close all stages
• `out <-` must be interruptible everywhere
• every channel producing function provided “done”
• https://play.golang.org/p/Rd-hEVic0O
15. Errors
• can happen anywhere
• second output channel
• https://play.golang.org/p/aUv5MrD7Bj
16. Errors Take 2
• https://godoc.org/golang.org/x/net/context
• need a “pipeline context”
• signal done and place to write errors
• WIP idea
• https://play.golang.org/p/-sn3QGpc7X
17. Pipelines
• `out <-` always interruptible by `done`
• close what you create
• error channel/pipeline context
• often repetitive…
23. Meant to write files
• stderr for communicating to the user
• silent in proper operation
• side effect (file) then committed to repository
• can also generate _test.go file