title: JSON omitempty omitting non-empty values
body: <p>I have this struct:</p>
  <pre><code>type Proxy struct {
      Ip string
      Port string
      Username string `json:&quot;group,omitempty&quot; bson:&quot;,omitempty&quot;`
      Password string `json:&quot;group,omitempty&quot; bson:&quot;,omitempty&quot;`
  }
  </code></pre>
  <p><code>Username</code> and <code>Password</code> values are assigned (but they can be nil or empty, thats why i want to omit them in such case).</p>
  <pre><code>    proxy := &amp;Proxy{}
  
      proxy.Ip = &quot;1.1.1.1&quot;;
      proxy.Port = &quot;1111&quot;;
      proxy.Username = &quot;user&quot;;
      proxy.Password = &quot;pass&quot;;
  </code></pre>
  <p>However they are omitted in <code>json</code> output:</p>
  <pre><code>    json, err := json.Marshal(proxy)
      if err != nil {
          log.Println(err)
      }
      log.Println(string(str))
  </code></pre>
  <p>the <code>log.Println(string(str))</code> output is following:</p>
  <pre><code>{&quot;Ip&quot;:&quot;1.1.1.1&quot;,&quot;Port&quot;:&quot;1111&quot;}
  </code></pre>
  <p>What could be the reason for them to be missing in JSON output?</p>