You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12345678910111213 |
- package common
-
- // Last returns the last value received from the channel before it was closed
- func Last(channel <-chan int) (res int) {
- for {
- o, more := <-channel
- if more {
- res = o
- } else {
- return
- }
- }
- }
|