compiler: implement comparing channel values

This commit is contained in:
Ayke van Laethem
2019-05-13 20:35:20 +02:00
committed by Ron Evans
parent c981f14e61
commit 0a40219680
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import "time"
func main() {
ch := make(chan int)
println("len, cap of channel:", len(ch), cap(ch))
println("len, cap of channel:", len(ch), cap(ch), ch == nil)
go sender(ch)
n, ok := <-ch
+1 -1
View File
@@ -1,4 +1,4 @@
len, cap of channel: 0 0
len, cap of channel: 0 0 false
recv from open channel: 1 true
received num: 2
received num: 3