title: How expensive is []byte(string)?
body: <p>Let's convert <code>string</code> to <code>[]byte</code>:</p>
  
  <pre><code>func toBytes(s string) []byte {
    return []byte(s) // What happens here?
  }
  </code></pre>
  
  <p>How expensive is this cast operation? Is copying performed? As far as I see in Go specification: <em>Strings behave like slices of bytes but are immutable</em>, this should involve at least copying to be sure subsequent slice operations will not modify our string <code>s</code>. What happens with reverse conversation? Does <code>[]byte &lt;-&gt; string</code> conversation involve encoding/decoding, like utf8 &lt;-> runes?</p>