[go-nuts] New identifiers and selectors in short variable declarations

2018-01-09 Thread Jim Bishopp
Has there ever been a discussion about allowing new identifiers *and selectors *in short variable declarations? var a struct { x int } b, a.x := 1, 2 ERROR: expected identifier on left side of := -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] http.FileServer: how to serve static files requested from different domains?

2018-01-09 Thread Andy Balholm
Try: http.Handle(“domain1.com/assets/", http.StripPrefix("/", http.FileServer(http.Dir(*webrootdomain1 http.Handle(“domain2.com/assets/", http.StripPrefix("/", http.FileServer(http.Dir(*webrootdomain2 -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] http.FileServer: how to serve static files requested from different domains?

2018-01-09 Thread Ayan George
Constantine Vassilev wrote: > > I have web server serving requests from two domains: domain1.com and > domain2.com > The assets directories are different for the two domains. > > webrootdomain1/assets > and > webrootdomain2/assets > > How to make the handler for assets to

[go-nuts] http.FileServer: how to serve static files requested from different domains?

2018-01-09 Thread Constantine Vassilev
I have web server serving requests from two domains: domain1.com and domain2.com The assets directories are different for the two domains. webrootdomain1/assets and webrootdomain2/assets How to make the handler for assets to serve different directory depending from the requests from

Re: [go-nuts] New identifiers and selectors in short variable declarations

2018-01-09 Thread Ian Lance Taylor
On Tue, Jan 9, 2018 at 1:02 PM, Jim Bishopp wrote: > > Has there ever been a discussion about allowing new identifiers and > selectors in short variable declarations? > > var a struct { x int } > b, a.x := 1, 2 > > ERROR: expected identifier on left side of := That idea

Re: [go-nuts] New identifiers and selectors in short variable declarations

2018-01-09 Thread 'Kevin Malachowski' via golang-nuts
It is not a new declaration, it is definitely an assignment. This can be determined because (in Go) a new declaration has effects when closing over variables: https://play.golang.org/p/a_IZdOWeqYf (ignore the obvious race condition; it works the same but looks uglier with the requisite locks:

Re: [go-nuts] New identifiers and selectors in short variable declarations

2018-01-09 Thread matthewjuran
This works: b, a := 1, struct{ x int }{2} But this doesn’t: var a struct{ x int } b, a.x := Returns1And2() But this does: var a struct{ x int } var b int b, a.x = Returns1And2() And this does: var a int b, a := Returns1And2() Matt On Tuesday, January 9, 2018 at 5:59:49 PM UTC-6, Kevin

[go-nuts] Re: Pogreb - embedded key/value store for read-heavy workloads

2018-01-09 Thread Artem Krylysov
> > sync.RWMutex works well as an embedded struct field. Locking DB could be > db.Lock() instead of db.mu.Lock(), and the same could apply to other fields. I considered this option, but as Jakob mentioned earlier it would make the Locker interface public. Maybe consider making errFull or

Re: [go-nuts] New identifiers and selectors in short variable declarations

2018-01-09 Thread Ayan George
On 01/09/2018 04:45 PM, Ian Lance Taylor wrote: > On Tue, Jan 9, 2018 at 1:02 PM, Jim Bishopp > wrote: >> >> Has there ever been a discussion about allowing new identifiers and >> selectors in short variable declarations? >> >> var a struct { x int } b, a.x := 1, 2 >>

[go-nuts] Re: possible to create 32bit windows exe's of my code (for desktop apps) from my 64bit windows 10 machine?

2018-01-09 Thread evan
thank you both for the info! On Tuesday, January 9, 2018 at 9:18:07 PM UTC+8, evan wrote: > > i have a 64bit windows 10 development machine. some of the machines in > our production environment are still 32bit windows 8.x and 7.x machines. > > would it be possible for me to create exe's for

[go-nuts] possible to create 32bit windows exe's of my code (for desktop apps) from my 64bit windows 10 machine?

2018-01-09 Thread Tamás Gulácsi
Yes. Just set the GOARCH env var to 386, and "go build" with that. -- 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

[go-nuts] possible to create 32bit windows exe's of my code (for desktop apps) from my 64bit windows 10 machine?

2018-01-09 Thread evan
i have a 64bit windows 10 development machine. some of the machines in our production environment are still 32bit windows 8.x and 7.x machines. would it be possible for me to create exe's for those 32 bit machines from my 64bit development machine? if yes, how? -- You received this message

Re: [go-nuts] possible to create 32bit windows exe's of my code (for desktop apps) from my 64bit windows 10 machine?

2018-01-09 Thread Jan Mercl
On Tue, Jan 9, 2018 at 2:18 PM evan wrote: > i have a 64bit windows 10 development machine. some of the machines in our production environment are still 32bit windows 8.x and 7.x machines. > > would it be possible for me to create exe's for those 32 bit machines from my

Re: [go-nuts] Pogreb - embedded key/value store for read-heavy workloads

2018-01-09 Thread matthewjuran
Not exporting the mutex and other fields is a good consideration and probably does apply here. I'll keep that in mind. Thanks, Matt On Tuesday, January 9, 2018 at 12:15:55 AM UTC-6, Jakob Borg wrote: > > On 8 Jan 2018, at 23:35, matthe...@gmail.com wrote: > > > sync.RWMutex works well as an

[go-nuts] database / sql transaction error handling questions

2018-01-09 Thread evan
after reading https://golang.org/pkg/database/sql/, i'm still not quite sure how to do error handling with respect to tx (transaction) operations. coming from a java/c# background, where once an exception is raised, i know what to do in the "catch" and "finally" blocks, i'm not as sure with go