From c3eb4429001d35e77fca9c7f0848721676b37cde Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 26 Aug 2021 22:32:34 -0700 Subject: [PATCH] [Go-client] Fix the ineffectual assignment to `err` in `decode` (#10275) Fixes: #10064 Signed-off-by: Bo Chen --- .../openapi-generator/src/main/resources/go/client.mustache | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 06a0ab7b9dc..a9b82e3ff7d 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -421,6 +421,9 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Write(b) + if err != nil { + return + } _, err = (*f).Seek(0, io.SeekStart) return }