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
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 Mala
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: h
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
>>
>> ERROR: expected ident
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 appears in https://golang.
>
> 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 other
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" grou
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
"golang
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 serve different directo
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 different
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 emb
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 thos
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 m
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 64bit development machine?
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 be
15 matches
Mail list logo