Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify interface check way #3327

Merged
merged 1 commit into from Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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