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