mirror of
https://github.com/gin-gonic/gin.git
synced 2026-04-29 23:23:18 +08:00
fix: check error return value in test
This commit is contained in:
parent
d3bec39bd7
commit
e755eb8ce6
@ -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:
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user