缓冲通道是否维持秩序?

In Go, do buffered channels have any order guarantee?

For example: you have two goroutines A & B that share a channel. A pushes data onto the channel while B reads from it. Are you guranted that B will read data In the same order that A put it into the channel?

I understand that if there are multiple producers or consumers the order may be non-deterministic, but I'm specifically asking about having just 1 producer and 1 consumer.

You can see the idea of channel illustrated in "The Nature Of Channels In Go": it shows how the order or read/write is respected.
See also Channels:

Receivers always block until there is data to receive.

  • If the channel is unbuffered, the sender blocks until the receiver has received the value.
  • If the channel has a buffer, the sender blocks only until the value has been copied to the buffer; if the buffer is full, this means waiting until some receiver has retrieved a value.

Unbuffered Channels

http://3.bp.blogspot.com/-vnJIWvlbP-E/UwDVICJKB9I/AAAAAAAANX0/T04V_58i8Vs/s1600/Screen+Shot+2014-02-16+at+10.10.54+AM.png

Buffered Channel

http://1.bp.blogspot.com/-GkVAtGeUzrs/UwIQ6AezJmI/AAAAAAAANYE/5XWpxN-zA3w/s1600/Screen+Shot+2014-02-17+at+8.38.15+AM.png