title: When should a type be a struct containing another type and when should it just "extend"(?) that type?
body: <p>I'm currently learning Go by doing the <a href="http://rosalind.info" rel="nofollow">rosalind problems</a> (basically a bunch of bioinformatics related code katas). </p>
  
  <p>I'm currently representing a DNA strand with a type:</p>
  
  <pre><code>type DNAStrand struct {
      dna byte[]
  }
  </code></pre>
  
  <p>My initial reason was to encapsulate the byte slice so I would know it only contained bytes representing the nucleotides: <code>'A', 'C', 'G', 'T'</code>. I realized that this was obviously not guarateed since I could simply do:</p>
  
  <pre><code>DNAStrand{[]byte("foo bar")}
  </code></pre>
  
  <p>And there is no longer any guarantee that my dna strand contains a byte array with only elements from those four bytes.</p>
  
  <p>Since my struct only contains a byte array is it better/more ideomatic to do:</p>
  
  <pre><code>type DNAStrand []byte
  </code></pre>
  
  <p>Or is it better to let the type contain the dna strand? Are there any rules of thumb for when to use either of the two approaches?</p>