gofmt code

This commit is contained in:
easonlin 2017-06-13 00:27:38 +08:00
parent 53799774f4
commit d425bf52b6
3 changed files with 5 additions and 6 deletions

View File

@ -87,7 +87,7 @@ func (c *Context) HandlerName() string {
// Handler returns the main handler. // Handler returns the main handler.
func (c *Context) Handler() HandlerFunc { func (c *Context) Handler() HandlerFunc {
return c.handlers.Last() return c.handlers.Last()
} }
/************************************/ /************************************/

View File

@ -283,13 +283,12 @@ var handlerTest HandlerFunc = func(c *Context) {
} }
func TestContextHandler(t *testing.T) { func TestContextHandler(t *testing.T) {
c, _ := CreateTestContext(httptest.NewRecorder()) c, _ := CreateTestContext(httptest.NewRecorder())
c.handlers = HandlersChain{func(c *Context) {}, handlerTest} c.handlers = HandlersChain{func(c *Context) {}, handlerTest}
assert.Equal(t, reflect.ValueOf(handlerTest).Pointer(), reflect.ValueOf(c.Handler()).Pointer()) assert.Equal(t, reflect.ValueOf(handlerTest).Pointer(), reflect.ValueOf(c.Handler()).Pointer())
} }
func TestContextQuery(t *testing.T) { func TestContextQuery(t *testing.T) {
c, _ := CreateTestContext(httptest.NewRecorder()) c, _ := CreateTestContext(httptest.NewRecorder())
c.Request, _ = http.NewRequest("GET", "http://example.com/?foo=bar&page=10&id=", nil) c.Request, _ = http.NewRequest("GET", "http://example.com/?foo=bar&page=10&id=", nil)