3
0
mirror of https://github.com/gin-gonic/gin.git synced 2025-04-06 03:57:46 +08:00
gin/helpers_test.go

15 lines
234 B
Go

package gin
import (
"net/http/httptest"
)
func CreateTestContext() (c *Context, w *httptest.ResponseRecorder, r *Engine) {
w = httptest.NewRecorder()
r = New()
c = r.allocateContext()
c.reset()
c.writermem.reset(w)
return
}