From 7a374f9a47b150ad2ef601c3f83cf8e0bf026268 Mon Sep 17 00:00:00 2001 From: Barnabus Date: Mon, 5 Nov 2018 16:17:04 +1000 Subject: [PATCH] Fix typos (#1626) --- binding/binding.go | 2 +- binding/protobuf.go | 2 +- context.go | 2 +- examples/grpc/gin/main.go | 2 +- logger.go | 2 +- routergroup.go | 4 ++-- tree_test.go | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/binding/binding.go b/binding/binding.go index 3a2aad9c..ecbce2fa 100644 --- a/binding/binding.go +++ b/binding/binding.go @@ -37,7 +37,7 @@ type BindingBody interface { // StructValidator is the minimal interface which needs to be implemented in // order for it to be used as the validator engine for ensuring the correctness -// of the reqest. Gin provides a default implementation for this using +// of the request. Gin provides a default implementation for this using // https://github.com/go-playground/validator/tree/v8.18.2. type StructValidator interface { // ValidateStruct can receive any kind of type and it should never panic, even if the configuration is not right. diff --git a/binding/protobuf.go b/binding/protobuf.go index 540e9c1f..f9ece928 100644 --- a/binding/protobuf.go +++ b/binding/protobuf.go @@ -29,7 +29,7 @@ func (protobufBinding) BindBody(body []byte, obj interface{}) error { if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil { return err } - // Here it's same to return validate(obj), but util now we cann't add + // Here it's same to return validate(obj), but util now we can't add // `binding:""` to the struct which automatically generate by gen-proto return nil // return validate(obj) diff --git a/context.go b/context.go index c8a59bb0..e5d91808 100644 --- a/context.go +++ b/context.go @@ -525,7 +525,7 @@ func (c *Context) BindQuery(obj interface{}) error { } // MustBindWith binds the passed struct pointer using the specified binding engine. -// It will abort the request with HTTP 400 if any error ocurrs. +// It will abort the request with HTTP 400 if any error occurs. // See the binding package. func (c *Context) MustBindWith(obj interface{}, b binding.Binding) (err error) { if err = c.ShouldBindWith(obj, b); err != nil { diff --git a/examples/grpc/gin/main.go b/examples/grpc/gin/main.go index edc1ca9b..820e65a3 100644 --- a/examples/grpc/gin/main.go +++ b/examples/grpc/gin/main.go @@ -19,7 +19,7 @@ func main() { defer conn.Close() client := pb.NewGreeterClient(conn) - // Set up a http setver. + // Set up a http server. r := gin.Default() r.GET("/rest/n/:name", func(c *gin.Context) { name := c.Param("name") diff --git a/logger.go b/logger.go index 5f986853..74dd2e6f 100644 --- a/logger.go +++ b/logger.go @@ -53,7 +53,7 @@ func Logger() HandlerFunc { return LoggerWithWriter(DefaultWriter) } -// LoggerWithWriter instance a Logger middleware with the specified writter buffer. +// LoggerWithWriter instance a Logger middleware with the specified writer buffer. // Example: os.Stdout, a file opened in write mode, a socket... func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { isTerm := true diff --git a/routergroup.go b/routergroup.go index 579aa7dc..9cb0b989 100644 --- a/routergroup.go +++ b/routergroup.go @@ -53,8 +53,8 @@ func (group *RouterGroup) Use(middleware ...HandlerFunc) IRoutes { return group.returnObj() } -// Group creates a new router group. You should add all the routes that have common middlwares or the same path prefix. -// For example, all the routes that use a common middlware for authorization could be grouped. +// Group creates a new router group. You should add all the routes that have common middlewares or the same path prefix. +// For example, all the routes that use a common middleware for authorization could be grouped. func (group *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup { return &RouterGroup{ Handlers: group.combineHandlers(handlers), diff --git a/tree_test.go b/tree_test.go index a1b3bbe7..92dc6956 100644 --- a/tree_test.go +++ b/tree_test.go @@ -12,7 +12,7 @@ import ( "testing" ) -// Used as a workaround since we can't compare functions or their addressses +// Used as a workaround since we can't compare functions or their addresses var fakeHandlerValue string func fakeHandler(val string) HandlersChain {