How to use AddSend?

I’m confused by the Selector.AddSend documentation.
The godoc claims:

// AddSend registers a callback function to be called when sending message to channel is not going to block.
// The callback is called when Select(ctx) is called.
// The sending message to the channel is expected to be done by the callback function
AddSend(c SendChannel, v interface{}, f func()) Selector

But what is v in this context, because I assumed it was the value you want to Send. Do I need to do this?

workflow.NewSelector(ctx).AddSend(myChan, myVal, func() {myChan.Send(myVal)})
1 Like