title: How to get the size of struct and its contents in bytes in golang?
body: <p>I have a struct, say:</p>
  
  <pre><code>type ASDF struct {
      A   uint64
      B   uint64
      C   uint64
      D   uint64
      E   uint64
      F   string
  }
  </code></pre>
  
  <p>I create a slice of that struct: <code>a := []ASDF{}</code></p>
  
  <p>I do operations on that slice of the struct (adding/removing/updating structs that vary in contents); how can I get the total size <em>in bytes</em> (for memory) of the slice and its contents? Is there a built-in to do this or do I need to manually run a calculation using <code>unsafe.Sizeof</code> and then <code>len</code> each string?</p>