FAQ
How do I read a gob encoded byte stream if I don't know the types in the
data I'm receiving?

Keep getting:
gob: local interface type *interface {} can only be decoded from remote
interface type; received concrete type string

This happens even if I do (c is a net.Conn):
err = gob.NewEncoder(c).Encode(*interface{}(msg)*)

--

Search Discussions

  • Kyle Lemons at Oct 4, 2012 at 9:34 pm
    Encode can't tell the difference between passing a string and passing a
    string in an interface, because the string is stuffed into an interface
    automatically (because the argument is an interface). In any case, can you
    post a short snippet that demonstrates the problem?
    On Thu, Oct 4, 2012 at 4:51 AM, Rory McGuire wrote:

    How do I read a gob encoded byte stream if I don't know the types in the
    data I'm receiving?

    Keep getting:
    gob: local interface type *interface {} can only be decoded from remote
    interface type; received concrete type string

    This happens even if I do (c is a net.Conn):
    err = gob.NewEncoder(c).Encode(*interface{}(msg)*)

    --

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 4, '12 at 11:51a
activeOct 4, '12 at 9:34p
posts2
users2
websitegolang.org

2 users in discussion

Rory McGuire: 1 post Kyle Lemons: 1 post

People

Translate

site design / logo © 2022 Grokbase