title: Convert []string to []byte
body: <p>I am looking to convert a string array to a byte array in GO so I can write it down to a disk. What is an optimal solution to encode and decode a string array (<code>[]string</code>) to a byte array (<code>[]byte</code>)? </p>
  
  <p>I was thinking of iterating the string array twice, first one to get the actual size needed for the byte array and then a second one to write the length and actual string (<code>[]byte(str)</code>) for each element.</p>
  
  <p>The solution must be able to convert it the other-way; from a <code>[]byte</code> to a <code>[]string</code>.</p>