mattn / anko

Scriptable interpreter written in golang

Home Page:http://play-anko.appspot.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to check if a channel is closed?

brutella opened this issue · comments

In Go, I can check if a channel is closed by doing this.

ch := make(chan bool)
close(ch)
v, ok := <- ch
if !ok { // channel is closed
}

When I do a similar think in anko, I get an error: undefined symbol 'v'.

ch = make(chan bool)
close(ch)
v, ok = <- ch // error: undefined symbol 'v'

Is there a way to check if a channel is closed in anko?

Sorry, this works as expected.