title: Unmarshal/Marshal json with int set to 0 does not seem to work
body: <p>I am trying to parse a <strong>json</strong> object into a <strong>struct</strong>, but <em>integer</em> values set to 0 won't work.</p>
  
  <pre><code>q := []byte(`{"string":"this is a string", "integer": 0}`)
  
  type Test struct {
      String string `json:"string,omitempty"`
      Integer int `json:"integer,omitempty"`
  }    
  
  var qq Test
  if err := json.Unmarshal(q, &amp;qq); err != nil {
     panic(err)
  }
  
  queryStr, err := json.Marshal(qq)
  if err != nil {
      panic(err)
  }
  fmt.Println(string(queryStr))
  // Output: {"string": "this is a string"}
  </code></pre>
  
  <p>if I set the integer to anything but 0, this works fine.</p>
  
  <p>even if I Unmarshal the object and set the Integer field to 0, Marshalling it back removes the "integer" field.</p>
  
  <p>Why? and how to get around this?</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>from what I gather from the comments, <code>omitempty</code> triggers when value is 0. So now the disappearance makes sense.</p>
  
  <p>I'm parsing json, editing it and forwarding it to another service, so this is unfortunate, especially as field not present defaults to other values than 0, and I would prefer not having to feed in the defaults for the downstream API.</p>
  
  <p>So is there a way to omit empty values but keep 0?</p>
  
  <p>or change empty to something else?</p>
  
  <p>Do I need to have 2 structs: one for input and one for output?</p>