title: What are the uses cases of omitempty in a Go struct?
body: <p>I'm curious what the use cases are for omit empty with the following:</p>
  
  <pre><code>type Example struct {
      ID           string  `json:",omitempty"`
      Name         string  `json:"name,omitempty"`
      exchangeRate float64 `json:"string"`
  }
  </code></pre>
  
  <p>I've read that <code>omitempty</code> prevents an empty value from showing up when the struct is printed, but I'm not positive about that. 
  Also, why would you include the name of the struct value i.e. <code>Name</code>, and <code>omitempty</code>?</p>