xconns-com / go-router

Automatically exported from code.google.com/p/go-router
0 stars 0 forks source link

What version of Go is this compatible to? #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to compile the lastest release of this. I first had to gofix 
everything to update the usage of "reflect", but I'm seeing some syntax that 
apparently isnt current anymore?

Example - notifier.go:60
ok := nc.chans[0] <- &IdChanInfoMsg{Info: []*IdChanInfo{info}}

Go doesnt seem to like trying to take a return value from a channel write 
operation?
I'm new to Go so I dont know the history of its syntax.

Thanks!

Original issue reported on code.google.com by justinis...@gmail.com on 22 Jul 2011 at 11:57

GoogleCodeExporter commented 8 years ago
>>>
Example - notifier.go:60
ok := nc.chans[0] <- &IdChanInfoMsg{Info: []*IdChanInfo{info}}

Go doesnt seem to like trying to take a return value from a channel write 
operation?
<<<

Go dropped non-blocking syntax for channel operations since Feb. You can 
replace them with "select"; similar to following transformation:
ok := chan<-val
if ok {
   Sent()
} else {
   NotSent()
}

is equivalent to:

select {
case chan<-val:
   Sent()
default:
   NotSent()
}

Original comment by yglg...@gmail.com on 1 Aug 2011 at 5:47