package main
import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
"net/http/httptest"
"testing"
)
func TestName(t *testing.T) {
recorder := httptest.NewRecorder()
c, _ := gin.CreateTestContext(recorder)
changeResponseCode(c)
fmt.Println(recorder.Code)
}
func changeResponseCode(ctx *gin.Context) {
ctx.Status(http.StatusNoContent)
}
Description
ctx.Status() does not affect httptest.ResponseRecorder while ctx.JSON() does
How to reproduce
Expectations
Actual result
Environment