harness-drone/vendor/github.com/gin-gonic/gin/test_helpers.go
2016-03-07 11:23:49 -08:00

14 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
}