forked from mirror/gin
fix: modify interface check way (#3327)
This commit is contained in:
parent
33ab0fc155
commit
51aea73ba0
|
@ -43,7 +43,7 @@ func (err SliceValidationError) Error() string {
|
|||
}
|
||||
}
|
||||
|
||||
var _ StructValidator = &defaultValidator{}
|
||||
var _ StructValidator = (*defaultValidator)(nil)
|
||||
|
||||
// ValidateStruct receives any kind of type, but only performed struct or pointer to struct type.
|
||||
func (v *defaultValidator) ValidateStruct(obj any) error {
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var _ context.Context = &Context{}
|
||||
var _ context.Context = (*Context)(nil)
|
||||
|
||||
// Unit tests TODO
|
||||
// func (c *Context) File(filepath string) {
|
||||
|
|
|
@ -39,7 +39,7 @@ type Error struct {
|
|||
|
||||
type errorMsgs []*Error
|
||||
|
||||
var _ error = &Error{}
|
||||
var _ error = (*Error)(nil)
|
||||
|
||||
// SetType sets the error's type.
|
||||
func (msg *Error) SetType(flags ErrorType) *Error {
|
||||
|
|
2
gin.go
2
gin.go
|
@ -166,7 +166,7 @@ type Engine struct {
|
|||
trustedCIDRs []*net.IPNet
|
||||
}
|
||||
|
||||
var _ IRouter = &Engine{}
|
||||
var _ IRouter = (*Engine)(nil)
|
||||
|
||||
// New returns a new blank Engine instance without any middleware attached.
|
||||
// By default, the configuration is:
|
||||
|
|
|
@ -49,7 +49,7 @@ type responseWriter struct {
|
|||
status int
|
||||
}
|
||||
|
||||
var _ ResponseWriter = &responseWriter{}
|
||||
var _ ResponseWriter = (*responseWriter)(nil)
|
||||
|
||||
func (w *responseWriter) reset(writer http.ResponseWriter) {
|
||||
w.ResponseWriter = writer
|
||||
|
|
|
@ -58,7 +58,7 @@ type RouterGroup struct {
|
|||
root bool
|
||||
}
|
||||
|
||||
var _ IRouter = &RouterGroup{}
|
||||
var _ IRouter = (*RouterGroup)(nil)
|
||||
|
||||
// Use adds middleware to the group, see example code in GitHub.
|
||||
func (group *RouterGroup) Use(middleware ...HandlerFunc) IRoutes {
|
||||
|
|
Loading…
Reference in New Issue