Skip to content

Commit

Permalink
fix: modify interface check way (#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoManito committed Oct 19, 2022
1 parent 33ab0fc commit 51aea73
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion binding/default_validator.go
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion context_test.go
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gin.go
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion response_writer.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion routergroup.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 51aea73

Please sign in to comment.