[go-nuts] Re: JSON empty slice and/or empty set encoding question/proposal

2017-03-30 Thread traetox
That does indeed work, but requires a call to "NewFoo" every time i marshal (invoking an allocation and subsequent GC). The application I am building is extremely memory intensive so I would like to be able to avoid that. I am totally willing to put in the work on the standard library Marshaller

[go-nuts] Re: JSON empty slice and/or empty set encoding question/proposal

2017-03-30 Thread C Banning
Why not provide a "NewFoo() *Foo" function instead? https://play.golang.org/p/GE8cMgwe24 On Monday, March 27, 2017 at 10:42:46 AM UTC-6, traetox wrote: > > Hello all, > > I have swept through the list and gone through the pkg/encoding/json > package and _believe_ I haven't missed anything, but a