diff options
author | cornelk <[email protected]> | 2020-05-11 20:54:22 +0300 |
---|---|---|
committer | Ayke <[email protected]> | 2020-05-12 01:17:27 +0200 |
commit | 7e64bc8f779994eec060f7cbe6325e9787c1a827 (patch) | |
tree | d33789807f0f8daab2811c3f49b19b27f2502809 /testdata/channel.go | |
parent | 1461563e3f4c6809049f123f5af6530a48db8274 (diff) | |
download | tinygo-7e64bc8f779994eec060f7cbe6325e9787c1a827.tar.gz tinygo-7e64bc8f779994eec060f7cbe6325e9787c1a827.zip |
runtime: add cap and len support for chans
Diffstat (limited to 'testdata/channel.go')
-rw-r--r-- | testdata/channel.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/testdata/channel.go b/testdata/channel.go index 52d498fcb..e1acea7ea 100644 --- a/testdata/channel.go +++ b/testdata/channel.go @@ -9,7 +9,11 @@ import ( var wg sync.WaitGroup func main() { - ch := make(chan int) + ch := make(chan int, 2) + ch <- 1 + println("len, cap of channel:", len(ch), cap(ch), ch == nil) + + ch = make(chan int) println("len, cap of channel:", len(ch), cap(ch), ch == nil) wg.Add(1) |