Yes, it makes them smaller I agree, however shouldn't the lack of a value
on decoding be considered like a zero value was encoded?  I think that is
the question here.

On Sat, Dec 10, 2016, 4:14 AM Jesse McNelis <jes...@jessta.id.au> wrote:

> On Sat, Dec 10, 2016 at 5:49 PM, Hoping White <baihaop...@gmail.com>
> wrote:
> > Hi, all
> >
> > I find that gob encoding ignores fields when they have zero values.
> > I wonder if this is a bug or an feature?
> >
>
> " If a field has the zero value for its type (except for arrays; see
> above), it is omitted from the transmission."
> https://golang.org/pkg/encoding/gob/#hdr-Encoding_Details
>
> It's a feature, it makes gobs smaller.
>
> --
> 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 more options, visit https://groups.google.com/d/optout.
>

-- 
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 more options, visit https://groups.google.com/d/optout.

Reply via email to