So, just a note... the CancelFunc type doesn't prevent you from passing in 
any old func(), since those are considered effectively literals (IIRC), so 
they can be automatically converted to the CancelFunc type.  For 
example: https://play.golang.org/p/QNbVXorlEQ

The only time the compiler will stop you from passing a function into 
something that takes a CancelFunc is if it already has a different 
type: https://play.golang.org/p/_inqL2nSBo   

My guess is that it was done so that they could document the type once, and 
then everywhere they used that type, the documentation "applies" and 
wouldn't need to be rewritten.  Which is sorta valid, but I feel like a 
package level documentation note would have served the same purpose.

And yeah, the named types thing looks like it was probably just not updated 
to be consistent for whatever reason.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to