Re: [go-nuts] Re: How to initialize all members of a slice

2016-10-04 Thread ahmed . momena
Thank you guys for helping me out. The problem was not with "string" type members, it was "bool" type. I wanted to set the default as true if it was not present in the input. Without using unmarshallJSON, I have no way of setting it, right? On Monday, October 3, 2016 at 9:28:49 PM UTC-5, Lars Sei

Re: [go-nuts] Re: How to initialize all members of a slice

2016-10-03 Thread Lars Seipel
On Mon, Oct 03, 2016 at 04:19:34PM -0700, C Banning wrote: > Lot's of people will jump up and down that this is "unsafe," but if you're > building a utility and have complete control of the code something like > this might work: https://play.golang.org/p/eDPoI83C0u Not necessarily unsafe, just u