mirror of https://github.com/gin-gonic/gin.git
Adds shortcut for disabling bind validation.
This commit is contained in:
parent
0c9f086b74
commit
0d1b9856ed
5
mode.go
5
mode.go
|
@ -8,6 +8,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin/binding"
|
||||||
"github.com/mattn/go-colorable"
|
"github.com/mattn/go-colorable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -51,6 +52,10 @@ func SetMode(value string) {
|
||||||
modeName = value
|
modeName = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DisableBindValidation() {
|
||||||
|
binding.Validator = nil
|
||||||
|
}
|
||||||
|
|
||||||
func Mode() string {
|
func Mode() string {
|
||||||
return modeName
|
return modeName
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue