~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/gob/decoder.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
func (dec *Decoder) recvType(id typeId) {
45
45
        // Have we already seen this type?  That's an error
46
46
        if id < firstUserId || dec.wireType[id] != nil {
47
 
                dec.err = os.ErrorString("gob: duplicate type received")
 
47
                dec.err = os.NewError("gob: duplicate type received")
48
48
                return
49
49
        }
50
50
 
143
143
                // will be absorbed by recvMessage.)
144
144
                if dec.buf.Len() > 0 {
145
145
                        if !isInterface {
146
 
                                dec.err = os.ErrorString("extra data in buffer")
 
146
                                dec.err = os.NewError("extra data in buffer")
147
147
                                break
148
148
                        }
149
149
                        dec.nextUint()
165
165
        // If e represents a value as opposed to a pointer, the answer won't
166
166
        // get back to the caller.  Make sure it's a pointer.
167
167
        if value.Type().Kind() != reflect.Ptr {
168
 
                dec.err = os.ErrorString("gob: attempt to decode into a non-pointer")
 
168
                dec.err = os.NewError("gob: attempt to decode into a non-pointer")
169
169
                return dec.err
170
170
        }
171
171
        return dec.DecodeValue(value)
180
180
                if v.Kind() == reflect.Ptr && !v.IsNil() {
181
181
                        // That's okay, we'll store through the pointer.
182
182
                } else if !v.CanSet() {
183
 
                        return os.ErrorString("gob: DecodeValue of unassignable value")
 
183
                        return os.NewError("gob: DecodeValue of unassignable value")
184
184
                }
185
185
        }
186
186
        // Make sure we're single-threaded through here.