title: How to show empty object instead of empty struct or nil in Go json marshal
body: <p>I need to show json's empty object <code>{}</code> when do <code>json.Marshal()</code> for a struct pointer. I can only output either <code>null</code> value or empty struct value. </p>
  
  <p>If the <code>person</code> key is filled with <code>&amp;Person{}</code> or <code>new(Person)</code>, it will show empty struct like below:</p>
  
  <pre><code>{
      "data": {
          "person": {
              "name": "",
              "age": 0
          },
          "created_date": "2009-11-10T23:00:00Z"
      }
  }
  </code></pre>
  
  <p>And if we don't initialize it at all, it will show <code>null</code>.</p>
  
  <pre><code>{
      "data": {
          "person": null,
          "created_date": "2009-11-10T23:00:00Z"
      }
  }
  </code></pre>
  
  <p>I want to show <code>"person": {}</code>. Is it possible?</p>
  
  <p>Go Playground for the complete code: <a href="https://play.golang.org/p/tT15G2ESPVc" rel="noreferrer">https://play.golang.org/p/tT15G2ESPVc</a></p>