From c5f21f73a422a22715cca2d70d4a8418c6046bd1 Mon Sep 17 00:00:00 2001 From: Icelain Date: Mon, 25 Dec 2023 19:31:37 +0530 Subject: [PATCH] follow best practices by adding resp.Body.Close() (#1708) --- examples/golang-simplegenerate/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/golang-simplegenerate/main.go b/examples/golang-simplegenerate/main.go index 26e3bc6d..f4ca32f4 100644 --- a/examples/golang-simplegenerate/main.go +++ b/examples/golang-simplegenerate/main.go @@ -18,6 +18,8 @@ func main() { os.Exit(1) } + defer resp.Body.Close() + responseData, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err)