From 5f76ba2022fdc3ebf06cc3349d3fc7645ef5aab5 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Fri, 22 May 2015 02:24:13 +0200 Subject: [PATCH] Context.Engine renamed to Context.engine --- context.go | 4 ++-- context_test.go | 4 ++-- gin.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/context.go b/context.go index ba493ad..4259a6b 100644 --- a/context.go +++ b/context.go @@ -70,7 +70,7 @@ type Context struct { handlers HandlersChain index int8 - Engine *Engine + engine *Engine Keys map[string]interface{} Errors errorMsgs Accepted []string @@ -328,7 +328,7 @@ func (c *Context) Render(code int, r render.Render) { // It also updates the HTTP code and sets the Content-Type as "text/html". // See http://golang.org/doc/articles/wiki/ func (c *Context) HTML(code int, name string, obj interface{}) { - instance := c.Engine.HTMLRender.Instance(name, obj) + instance := c.engine.HTMLRender.Instance(name, obj) c.Render(code, instance) } diff --git a/context_test.go b/context_test.go index c612471..eacca3d 100644 --- a/context_test.go +++ b/context_test.go @@ -36,7 +36,7 @@ func createTestContext() (c *Context, w *httptest.ResponseRecorder, r *Engine) { func TestContextReset(t *testing.T) { router := New() c := router.allocateContext() - assert.Equal(t, c.Engine, router) + assert.Equal(t, c.engine, router) c.index = 2 c.Writer = &responseWriter{ResponseWriter: httptest.NewRecorder()} @@ -110,7 +110,7 @@ func TestContextCopy(t *testing.T) { assert.Equal(t, cp.Request, c.Request) assert.Equal(t, cp.index, AbortIndex) assert.Equal(t, cp.Keys, c.Keys) - assert.Equal(t, cp.Engine, c.Engine) + assert.Equal(t, cp.engine, c.engine) assert.Equal(t, cp.Params, c.Params) } diff --git a/gin.go b/gin.go index 08fc0f6..cc27da8 100644 --- a/gin.go +++ b/gin.go @@ -90,7 +90,7 @@ func Default() *Engine { } func (engine *Engine) allocateContext() (context *Context) { - return &Context{Engine: engine} + return &Context{engine: engine} } func (engine *Engine) LoadHTMLGlob(pattern string) {