title: json.Unmarshal nested object into string or []byte
body: <p>I'm trying to Unmarshal some json so that a nested object does not get parsed but just treated as a <code>string</code> or <code>[]byte</code>.</p>
  <p>So I want to get the following:</p>
  <pre><code>{
      &quot;id&quot;  : 15,
      &quot;foo&quot; : { &quot;foo&quot;: 123, &quot;bar&quot;: &quot;baz&quot; }
  }
  </code></pre>
  <p>Unmarshaled into:</p>
  <pre><code>type Bar struct {
      ID  int64  `json:&quot;id&quot;`
      Foo []byte `json:&quot;foo&quot;`
  }
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>json: cannot unmarshal object into Go value of type []uint8
  </code></pre>
  <p><a href="http://play.golang.org/p/DmachtNtNb" rel="nofollow noreferrer">playground demo</a></p>