wfxiang08 / goprotobuf

Automatically exported from code.google.com/p/goprotobuf
Other
0 stars 0 forks source link

if isMarshaler should be if isUnmarshaler in decode.go #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Create an Unmarshal method for a struct and don't create a Marshal method.
The Unmarshal method will not be used for decoding the struct.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

newest

Please provide any additional information below.

This code in decode.go

    // If the object can unmarshal itself, let it.
    if p.isMarshaler {
        iv := structPointer_Interface(bas, p.stype)
        return iv.(Unmarshaler).Unmarshal(raw)
    }

Should be 

        if p.isUnmarshaler {

Original issue reported on code.google.com by awalterschulze on 21 Jun 2013 at 4:56

GoogleCodeExporter commented 9 years ago

Original comment by dsymo...@golang.org on 23 Jun 2013 at 11:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision c31cbc77cd48.

Original comment by dsymo...@golang.org on 24 Jun 2013 at 12:57