Merge branch 'master' into docs/add-fnproject

This commit is contained in:
Bo-Yi Wu 2018-08-30 23:37:35 +08:00 committed by GitHub
commit 58d383276a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 8 additions and 32 deletions

View File

@ -557,7 +557,7 @@ func main() {
// Example for binding JSON ({"user": "manu", "password": "123"}) // Example for binding JSON ({"user": "manu", "password": "123"})
router.POST("/loginJSON", func(c *gin.Context) { router.POST("/loginJSON", func(c *gin.Context) {
var json Login var json Login
if err := c.ShouldBindXML(&json); err != nil { if err := c.ShouldBindJSON(&json); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return return
} }

View File

@ -9,7 +9,7 @@ import (
"io" "io"
"net/http" "net/http"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/internal/json"
) )
// EnableDecoderUseNumber is used to call the UseNumber method on the JSON // EnableDecoderUseNumber is used to call the UseNumber method on the JSON

View File

@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/internal/json"
) )
type ErrorType uint64 type ErrorType uint64

View File

@ -8,7 +8,7 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/internal/json"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -10,7 +10,7 @@ import (
"html/template" "html/template"
"net/http" "net/http"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/internal/json"
) )
type JSON struct { type JSON struct {

View File

@ -9,7 +9,7 @@ package render
import ( import (
"net/http" "net/http"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/internal/json"
) )
type PureJSON struct { type PureJSON struct {

28
vendor/vendor.json vendored
View File

@ -27,8 +27,8 @@
"path": "github.com/json-iterator/go", "path": "github.com/json-iterator/go",
"revision": "1624edc4454b8682399def8740d46db5e4362ba4", "revision": "1624edc4454b8682399def8740d46db5e4362ba4",
"revisionTime": "2018-08-06T06:07:27Z", "revisionTime": "2018-08-06T06:07:27Z",
"version": "1.1.5", "version": "v1.1",
"versionExact": "1.1.5" "versionExact": "v1.1.5"
}, },
{ {
"checksumSHA1": "y/A5iuvwjytQE2CqVuphQRXR2nI=", "checksumSHA1": "y/A5iuvwjytQE2CqVuphQRXR2nI=",
@ -38,24 +38,6 @@
"version": "v0.0.3", "version": "v0.0.3",
"versionExact": "v0.0.3" "versionExact": "v0.0.3"
}, },
{
"checksumSHA1": "ZTcgWKWHsrX0RXYVXn5Xeb8Q0go=",
"path": "github.com/modern-go/concurrent",
"revision": "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94",
"revisionTime": "2018-03-06T01:26:44Z"
},
{
"checksumSHA1": "qvH48wzTIV3QKSDqI0dLFtVjaDI=",
"path": "github.com/modern-go/reflect2",
"revision": "94122c33edd36123c84d5368cfb2b69df93a0ec8",
"revisionTime": "2018-07-18T01:23:57Z"
},
{
"checksumSHA1": "LuFv4/jlrmFNnDb/5SCSEPAM9vU=",
"path": "github.com/pmezard/go-difflib/difflib",
"revision": "792786c7400a136282c1664665ae0a8db921c6c2",
"revisionTime": "2016-01-10T10:55:54Z"
},
{ {
"checksumSHA1": "c6pbpF7eowwO59phRTpF8cQ80Z0=", "checksumSHA1": "c6pbpF7eowwO59phRTpF8cQ80Z0=",
"path": "github.com/stretchr/testify/assert", "path": "github.com/stretchr/testify/assert",
@ -79,12 +61,6 @@
"revision": "d4c55e66d8c3a2f3382d264b08e3e3454a66355a", "revision": "d4c55e66d8c3a2f3382d264b08e3e3454a66355a",
"revisionTime": "2016-10-18T08:54:36Z" "revisionTime": "2016-10-18T08:54:36Z"
}, },
{
"checksumSHA1": "7Gocawl8bm27cpAILtuf21xvVD8=",
"path": "golang.org/x/sys/unix",
"revision": "1c9583448a9c3aa0f9a6a5241bf73c0bd8aafded",
"revisionTime": "2018-08-15T07:37:39Z"
},
{ {
"checksumSHA1": "P/k5ZGf0lEBgpKgkwy++F7K1PSg=", "checksumSHA1": "P/k5ZGf0lEBgpKgkwy++F7K1PSg=",
"path": "gopkg.in/go-playground/validator.v8", "path": "gopkg.in/go-playground/validator.v8",