gob attempting to decode nil value results in EOF error
<p>I need to use the <code>gob</code> to encode some data, however, I find that "type nil" can not be processed correctly (go 1.6.2)</p>

<p><a href="https://play.golang.org/p/faypK8uobF" rel="nofollow">https://play.golang.org/p/faypK8uobF</a></p>

<pre class="lang-go prettyprint-override"><code>package main

import (
    "bytes"
    "encoding/gob"
    "log"
)

type T struct {
    A int
}

func init() {
    gob.Register(map[string]interface{}{})
    gob.Register(new(T))
}
func main() {
    bys := bytes.NewBuffer(nil)
    gob.NewEncoder(bys).Encode(map[string]interface{}{
        "v": (*T)(nil),
    })
    out := map[string]interface{}{}
    if err := gob.NewDecoder(bys).Decode(&amp;out); err != nil {
        log.Panic(err)
    }
    return
}
</code></pre>

<p>Output:</p>

<pre><code>panic: EOF
</code></pre>