[go-nuts] Support for context cancellation by sql drivers

2017-05-14 Thread Felipe Spinolo
In 1.8, database/sql added support for context cancellation on DB methods (e.g. QueryContext, ExecContext, etc.). In the godoc, there is a note stating that "Drivers that do not support context cancelation will not return until after the query is completed." However, I have not been able to

[go-nuts] Re: encoding/gob decode []byte to multi struct types

2017-01-17 Thread Felipe Spinolo
Why not just create a wrapper struct? Something like: type Mixed struct{ A *A B *B } And then just encode/decode that? On Tuesday, January 17, 2017 at 1:16:37 PM UTC-8, casp...@gmail.com wrote: > > I got two struct types encoded into bytes by gob, I want to decode the > bytes into a

[go-nuts] Re: Applying idiomatic Golang patterns to other languages?

2017-01-17 Thread Felipe Spinolo
I think it's a mistake to try to apply one language's idioms to another language. I don't write Go the way I would write Java or Python, and I don't write either of them the way I would write Go. Idiomatic Go is idiomatic because it fits with the design and philosophy of Go. On Monday,