└── README.MD /README.MD: -------------------------------------------------------------------------------- 1 | # Result of channel operations given a channel's state 2 | 3 | | Operation | Channel state | Result | 4 | |-----------|----------------------|------------------------------------------------------------------------------------------| 5 | | Read | `nil` | Block | 6 | | | Open and Not Empty | Value | 7 | | | Open and Empty | Block | 8 | | | Closed | [default value], false | 9 | | | Write Only | Compilation Error | 10 | | Write | `nil` | Block | 11 | | | Open and Full | Block | 12 | | | Open and Not Full | Write Value | 13 | | | Closed | **panic** | 14 | | | Receive Only | Compilation Error | 15 | | `close` | `nil` | panic | 16 | | | Open and Not Empty | Closes Channel; reads succeed until channel is drained, then reads produce default value | 17 | | | Open and Empty | Closes Channel; reads produces default value | 18 | | | Closed | **panic** | 19 | | | Receive Only | Compilation Error | 20 | 21 | Source: *Page 76 of Concurrency in Go (by Katherine Cox-Buday)* --------------------------------------------------------------------------------