[go-nuts] Re: A few go 2 suggestions

2017-10-10 Thread rsr via golang-nuts
Toy syntax to address fork-join patterns:

go somefunc() (foo int64 /* must match return of somefunc()) { 
// this block executed when the goroutine for somefunc() terminates; 
return values of somefunc are values of signature
// as a defer-equivalent so that the defer() for panic recovery is in 
place
if r := recover(); r != nil {}
...
}

which is almost exactly equivalent to writing:

go func() {
defer func() { 
if r := recover(); r != nil {... // some logic here; but actually 
executes ater somefunc()}
} 
 x, y, ...:= somefunc() 
// this block executed somefunc() terminates; return values of somefunc 
are locals; logic 
// is split into the function above and here
}

... other than the inverted structure of the latter, the real issue is it's 
hard to write a nice-to-use join-er generator as a package function since 
it needs to take a lot of different signatures. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-05 Thread rsr via golang-nuts
for some of our sensitive structures that are tricky and have multiple 
fields of the same type, there is a trick you can use:

type bar struct {
   A int
   _ bool
}

see https://play.golang.org/p/rFKGoKq-S9


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread rsr via golang-nuts
is it possible your windows host is behind either an explicit proxy or a 
transparent proxy (like bluecoat)? 

for the explicit case, 

reg query 
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet 
Settings"

look for "proxyserver" or "AutoConfigURL"


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.