From ee16e2eb30df2fd3ae2219fe95ade0941515b490 Mon Sep 17 00:00:00 2001 From: moriyoshi Date: Sun, 27 Jun 2010 03:02:18 +0900 Subject: [PATCH] Handle unsupported typecode --- go/unpack.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/unpack.go b/go/unpack.go index 3ca4804..a375311 100644 --- a/go/unpack.go +++ b/go/unpack.go @@ -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