Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omitempty tags implemented. #164

Closed
wants to merge 2 commits into from
Closed

Commits on Oct 23, 2016

  1. omitempty tags implemented

    struct fields can be tagged with
     `msg:",omitempty"`
    
    Such fields will not be serialized
    if they contain their zero values.
    
    For structs with many optional
    fields, the space and time savings
    can be substantial.
    
    From a zero-alloc standpoint,
    UnmarshalMsg and DecodeMsg continue,
    as before, to re-use existing fields in an
    object rather than allocating new
    ones. So, if you decode into the same
    object repeatedly, things like slices
    maps, and fields that point to other
    structures won't be re-allocated.
    
    Instead, maps and fields will be re-sized
    appropriately. In other words, mutable
    fields are simply mutated in-place.
    
    Fixes tinylib#103
    glycerine committed Oct 23, 2016
    Configuration menu
    Copy the full SHA
    68f025a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    16df849 View commit details
    Browse the repository at this point in the history