Closing pipes on goroutine