From e755eb8ce6d9f3a7bbaed53aa074e073187b8616 Mon Sep 17 00:00:00 2001 From: mehrdadbn9 Date: Thu, 12 Feb 2026 23:23:17 +0330 Subject: [PATCH] fix: check error return value in test --- context.go | 1 - gin_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/context.go b/context.go index 696b35f2..92fb3704 100644 --- a/context.go +++ b/context.go @@ -1057,7 +1057,6 @@ func (c *Context) requestHeader(key string) string { // bodyAllowedForStatus is a copy of http.bodyAllowedForStatus non-exported function. // Uses http.StatusContinue constant for better code clarity. -// Upper bound 199 covers all 1xx informational status codes. func bodyAllowedForStatus(status int) bool { switch { case status >= http.StatusContinue && status < http.StatusOK: diff --git a/gin_test.go b/gin_test.go index 22d920bc..22d3b87c 100644 --- a/gin_test.go +++ b/gin_test.go @@ -1090,7 +1090,7 @@ func TestServeErrorWritten(t *testing.T) { router := New() router.Use(func(c *Context) { c.Writer.WriteHeader(http.StatusNotFound) - c.Writer.Write([]byte("custom error")) + _, _ = c.Writer.Write([]byte("custom error")) c.Next() }) router.NoRoute(func(c *Context) {