Handle unsupported typecode

This commit is contained in:
moriyoshi 2010-06-27 03:02:18 +09:00 committed by Moriyoshi Koizumi
parent 003fb3392f
commit ee16e2eb30

View file

@ -4,6 +4,7 @@ import (
"io"
"os"
"unsafe"
"strconv"
"reflect"
)
@ -264,6 +265,8 @@ func unpack(reader io.Reader, reflected bool) (v reflect.Value, n int, err os.Er
}
nbytesread += n
if e != nil { return nil, nbytesread, e }
default:
panic("unsupported code: " + strconv.Itoa(int(c)))
}
}
return retval, nbytesread, nil