Relative Content

Tag Archive for gogoroutine

Why is this channel always returning the latest value?

I’ve been reading up on Go channels, and read that channels are FIFO. I created an unbuffered channel and a goroutine with a select like below, but am confused why the below always outputs the value 3 (the last value written to the channel)?