To profile my app, I want to know how many goroutines are waiting to write to or read from a channel; I can't find anything relevant in the reflect
package.
I can maintain an explicit counter of course, but I'd expect golang runtime to know that, so I try to avoid reinventing the wheel.
So, is there a way to do that without maintaining the counter manually?