title: How to get size of struct containing data structures in Go?
body: <p>I'm currently trying to get the size of a complex struct in Go.</p>
  
  <p>I've read solutions that use <code>reflect</code> and <code>unsafe</code>, but neither of these help with structs that contain arrays or maps (or any other field that's a pointer to an underlying data structure). </p>
  
  <p>Example:</p>
  
  <pre><code>type testStruct struct {
      A     int
      B     string
      C     struct{}
      items map[string]string
  }
  </code></pre>
  
  <p>How would I find out the correct byte size of the above if <code>items</code> contains a few values in it?</p>