diff options
author | Peter Harris <git@peter.is-a-geek.org> | 2011-02-03 21:05:09 -0500 |
---|---|---|
committer | Peter Harris <git@peter.is-a-geek.org> | 2011-02-03 21:05:09 -0500 |
commit | b930ee5192550419ed423694797fc9b9396e033a (patch) | |
tree | dd8b0df3072129417c822a511a8a27eb84a15767 | |
parent | 782c46ceb730a3a771e0e32ad8e417a39e702175 (diff) |
Update for latest go release: nonblocking channel read
-rw-r--r-- | xgob/util/atom.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xgob/util/atom.go b/xgob/util/atom.go index 4000e02..c9bb8b0 100644 --- a/xgob/util/atom.go +++ b/xgob/util/atom.go @@ -37,8 +37,11 @@ func (s *state) internAtom (name string) xproto.Atom { } else { c = xproto.InternAtom(s.c, false, name) } - reply, ok := <- c - if !ok { + var reply xproto.InternAtomReply + select { + case reply = <- c: + // done + default: s.c.Flush() reply = <- c } |