Re: [go-nuts] Assignment of pointer values in a struct...

2020-06-04 Thread Jan Mercl
On Thu, Jun 4, 2020 at 5:13 PM Trig wrote: > > And I did it again... posted from another gmail account by accident, and my > post is forever in 'approval status', lol. Basically what Robert here said. > > On Thursday, June 4, 2020 at 9:53:56 AM UTC-5, Robert Engels wrote: >> >> You need pointers

Re: [go-nuts] Assignment of pointer values in a struct...

2020-06-04 Thread Trig
And I did it again... posted from another gmail account by accident, and my post is forever in 'approval status', lol. Basically what Robert here said. On Thursday, June 4, 2020 at 9:53:56 AM UTC-5, Robert Engels wrote: > > You need pointers to strings if you need a nil value to be represented

Re: [go-nuts] Assignment of pointer values in a struct...

2020-06-04 Thread Robert Engels
You need pointers to strings if you need a nil value to be represented which is often the case in databases. > On Jun 4, 2020, at 9:30 AM, Saksham Saxena wrote: > > Yep perfectly fine. MongoDB Driver for Go also uses such a wrapper at many > places where it takes a string as an argument and

[go-nuts] Assignment of pointer values in a struct...

2020-06-04 Thread Saksham Saxena
Yep perfectly fine. MongoDB Driver for Go also uses such a wrapper at many places where it takes a string as an argument and returns a pointer to it which is required internally. Not really sure why use a pointer to strings in Go because they're immutable, but I guess to reach their own. -- Y

Re: [go-nuts] Assignment of pointer values in a struct...

2020-06-03 Thread Ian Lance Taylor
On Wed, Jun 3, 2020 at 7:33 PM Trig wrote: > > I posted this question the other day and don't see it (may have posted from > another gmail account and it's still pending approval)... so here I am again. > > Let's say I have something like below: > type ( >Person struct { > FirstName *st

[go-nuts] Assignment of pointer values in a struct...

2020-06-03 Thread Trig
I posted this question the other day and don't see it (may have posted from another gmail account and it's still pending approval)... so here I am again. Let's say I have something like below: type ( Person struct { FirstName *string } ) Usually, I see something like the following w