From 6f0a0ebbe8661f24797124803a4114eef08e6db9 Mon Sep 17 00:00:00 2001 From: Fabian <-> Date: Fri, 6 Mar 2020 18:34:41 +0100 Subject: [PATCH] return from decoding function at eof instead of break from the decoding loop --- reqest.go | 2 +- response.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reqest.go b/reqest.go index 8223e5b..f6d8db3 100644 --- a/reqest.go +++ b/reqest.go @@ -147,7 +147,7 @@ func (d *RequestDecoder) Decode(data io.Writer) (*Request, error) { // when we read from a stream, we may get an EOF if we want to read the end tag // all data should be read and we can ignore the error if err == io.EOF { - break + return req, nil } return nil, err } diff --git a/response.go b/response.go index 7ff3e7b..94a2230 100644 --- a/response.go +++ b/response.go @@ -223,7 +223,7 @@ func (d *ResponseDecoder) Decode(data io.Writer) (*Response, error) { // when we read from a stream, we may get an EOF if we want to read the end tag // all data should be read and we can ignore the error if err == io.EOF { - break + return resp, nil } return nil, err }