In golang from one go routine I'm posting message to a buffered channel. But my reader go routine may be little slow in processing, and any read from the channel may not happen faster. So to stop the channel buffer getting filled up I dont want the same data to be posted again in the buffered channel. Is there a way to do that?
Is there a way to do that?
No.
Channels (buffered or not) are opaque and you can do nothing but send or receive from them, they provide absolutely no further logic.