title: Unmarshal remaining JSON after performing custom unmarshalling
body: <p>I have a JSON object That contains an implementation of an interface within it. I'm attempting to take that JSON and marshal it into a struct whilst creating the implementation of the interface.</p>
  <p>I've managed to get it to implement the interface with a custom JSON unmarshal function however I'm struggling to piece together how to then marshal the rest of the fields</p>
  <p>I've created an example in the Go playground</p>
  <p><a href="https://play.golang.org/p/ztF7H7etdjM" rel="nofollow noreferrer">https://play.golang.org/p/ztF7H7etdjM</a></p>
  <p>My JSON being passed into my application is</p>
  <pre><code>{
  
     &quot;address&quot;:&quot;1FYuJ4MsVmpzPoFJ6svJMJfygn91Eubid9&quot;,
     &quot;nonce&quot;:13,
     &quot;network_id&quot;:&quot;qadre.demo.balance&quot;,
     &quot;challenge&quot;:&quot;f2b19e71876c087e681fc092ea3a34d5680bbfe772e40883563e1d5513bb593f&quot;,
     &quot;type&quot;:&quot;verifying_key&quot;,
     &quot;verifying_key&quot;:{
        &quot;verifying_key&quot;:&quot;3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29&quot;,
        &quot;fqdn&quot;:&quot;huski.service.key&quot;
     },
     &quot;signature&quot;:&quot;a3bf8ee202a508d5a5632f50b140b70b7095d8836493dc7ac4159f6f3350280078b3a58b2162a240bc8c7485894554976a9c7b5d279d3f5bf49fec950f024e02&quot;,
     &quot;fqdn&quot;:&quot;huski.service.SingleKeyProof&quot;
  }
  </code></pre>
  <p>I've attempted to do a json.Unmarshal and pass in a new struct for the remaining fields however it seems to put me in an infinite loop, my application hangs and then crashes</p>
  <p>The best solution I've come up with so far is to marshal the JSON into a `map[string]interface{} and do each field separately, this feels very clunky though</p>
  <pre><code>var m map[string]interface{}
  if err := json.Unmarshal(data, &amp;m); err != nil {
      return err
  }
  
  ad, ok := m[&quot;address&quot;]
  if ok {
      s.Address = ad.(string)
  }
  fqdn, ok := m[&quot;fqdn&quot;]
  if ok {
      s.FQDN = fqdn.(string)
  }
  n, ok := m[&quot;nonce&quot;]
  if ok {
      s.Nonce = int64(n.(float64))
  }
  c, ok := m[&quot;challenge&quot;]
  if ok {
      s.Challenge = []byte(c.(string))
  }
  network, ok := m[&quot;network_id&quot;]
  if ok {
      s.NetworkID = network.(string)
  }
  sig, ok := m[&quot;signature&quot;]
  if ok {
      s.Signature = []byte(sig.(string))
  }
  </code></pre>