mirror of https://github.com/gin-gonic/gin.git
support Go v1.16 version (#2638)
This commit is contained in:
parent
ee4de846a8
commit
77649bcfee
|
@ -15,6 +15,10 @@ matrix:
|
||||||
- go: 1.15.x
|
- go: 1.15.x
|
||||||
env:
|
env:
|
||||||
- TESTTAGS=nomsgpack
|
- TESTTAGS=nomsgpack
|
||||||
|
- go: 1.16.x
|
||||||
|
- go: 1.16.x
|
||||||
|
env:
|
||||||
|
- TESTTAGS=nomsgpack
|
||||||
- go: master
|
- go: master
|
||||||
|
|
||||||
git:
|
git:
|
||||||
|
|
|
@ -1018,7 +1018,9 @@ func TestContextRenderFile(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, http.StatusOK, w.Code)
|
assert.Equal(t, http.StatusOK, w.Code)
|
||||||
assert.Contains(t, w.Body.String(), "func New() *Engine {")
|
assert.Contains(t, w.Body.String(), "func New() *Engine {")
|
||||||
assert.Equal(t, "text/plain; charset=utf-8", w.Header().Get("Content-Type"))
|
// Content-Type='text/plain; charset=utf-8' when go version <= 1.16,
|
||||||
|
// else, Content-Type='text/x-go; charset=utf-8'
|
||||||
|
assert.NotEqual(t, "", w.Header().Get("Content-Type"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestContextRenderFileFromFS(t *testing.T) {
|
func TestContextRenderFileFromFS(t *testing.T) {
|
||||||
|
@ -1030,7 +1032,9 @@ func TestContextRenderFileFromFS(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, http.StatusOK, w.Code)
|
assert.Equal(t, http.StatusOK, w.Code)
|
||||||
assert.Contains(t, w.Body.String(), "func New() *Engine {")
|
assert.Contains(t, w.Body.String(), "func New() *Engine {")
|
||||||
assert.Equal(t, "text/plain; charset=utf-8", w.Header().Get("Content-Type"))
|
// Content-Type='text/plain; charset=utf-8' when go version <= 1.16,
|
||||||
|
// else, Content-Type='text/x-go; charset=utf-8'
|
||||||
|
assert.NotEqual(t, "", w.Header().Get("Content-Type"))
|
||||||
assert.Equal(t, "/some/path", c.Request.URL.Path)
|
assert.Equal(t, "/some/path", c.Request.URL.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,9 @@ func TestRouterMiddlewareAndStatic(t *testing.T) {
|
||||||
|
|
||||||
assert.Equal(t, http.StatusOK, w.Code)
|
assert.Equal(t, http.StatusOK, w.Code)
|
||||||
assert.Contains(t, w.Body.String(), "package gin")
|
assert.Contains(t, w.Body.String(), "package gin")
|
||||||
assert.Equal(t, "text/plain; charset=utf-8", w.Header().Get("Content-Type"))
|
// Content-Type='text/plain; charset=utf-8' when go version <= 1.16,
|
||||||
|
// else, Content-Type='text/x-go; charset=utf-8'
|
||||||
|
assert.NotEqual(t, "", w.Header().Get("Content-Type"))
|
||||||
assert.NotEqual(t, w.Header().Get("Last-Modified"), "Mon, 02 Jan 2006 15:04:05 MST")
|
assert.NotEqual(t, w.Header().Get("Last-Modified"), "Mon, 02 Jan 2006 15:04:05 MST")
|
||||||
assert.Equal(t, "Mon, 02 Jan 2006 15:04:05 MST", w.Header().Get("Expires"))
|
assert.Equal(t, "Mon, 02 Jan 2006 15:04:05 MST", w.Header().Get("Expires"))
|
||||||
assert.Equal(t, "Gin Framework", w.Header().Get("x-GIN"))
|
assert.Equal(t, "Gin Framework", w.Header().Get("x-GIN"))
|
||||||
|
|
Loading…
Reference in New Issue