Make CreateTestContext public without importing net/http/httptest

This commit is contained in:
Yehezkiel Syamsuhadi
2016-09-21 12:16:51 +10:00
parent f931d1ea80
commit 61ba9db5af
3 changed files with 88 additions and 54 deletions

13
test_helpers.go Normal file
View File

@ -0,0 +1,13 @@
package gin
import (
"net/http"
)
func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) {
r = New()
c = r.allocateContext()
c.reset()
c.writermem.reset(w)
return
}