From 05a0dca14f79215e18d4927e0db0b6de64caad9d Mon Sep 17 00:00:00 2001 From: Michael Bang Date: Sat, 11 Apr 2015 17:21:49 +0200 Subject: [PATCH] Add missing error checking. Remove unused field in struct. --- connection.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/connection.go b/connection.go index 30583f9..23480b2 100644 --- a/connection.go +++ b/connection.go @@ -87,11 +87,10 @@ func (c *Connection) readPkg() Pkg { } type Pkg struct { - Size int32 - Id int32 - Type int32 - Body []byte - _null int16 + Size int32 + Id int32 + Type int32 + Body []byte } type binaryReadWriter struct { @@ -114,5 +113,5 @@ func (b *binaryReadWriter) Read(v interface{}) { if b.err != nil || b.buf == nil { return } - binary.Read(b.buf, b.ByteOrder, v) + b.err = binary.Read(b.buf, b.ByteOrder, v) }