Skip to content

Commit 7a374f9

Browse files
jbamptonthinkerou
authored andcommitted
Fix typos (gin-gonic#1626)
1 parent 4f488ac commit 7a374f9

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

binding/binding.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type BindingBody interface {
3737

3838
// StructValidator is the minimal interface which needs to be implemented in
3939
// order for it to be used as the validator engine for ensuring the correctness
40-
// of the reqest. Gin provides a default implementation for this using
40+
// of the request. Gin provides a default implementation for this using
4141
// https://github.com/go-playground/validator/tree/v8.18.2.
4242
type StructValidator interface {
4343
// ValidateStruct can receive any kind of type and it should never panic, even if the configuration is not right.

binding/protobuf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (protobufBinding) BindBody(body []byte, obj interface{}) error {
2929
if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil {
3030
return err
3131
}
32-
// Here it's same to return validate(obj), but util now we cann't add
32+
// Here it's same to return validate(obj), but util now we can't add
3333
// `binding:""` to the struct which automatically generate by gen-proto
3434
return nil
3535
// return validate(obj)

context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ func (c *Context) BindQuery(obj interface{}) error {
525525
}
526526

527527
// MustBindWith binds the passed struct pointer using the specified binding engine.
528-
// It will abort the request with HTTP 400 if any error ocurrs.
528+
// It will abort the request with HTTP 400 if any error occurs.
529529
// See the binding package.
530530
func (c *Context) MustBindWith(obj interface{}, b binding.Binding) (err error) {
531531
if err = c.ShouldBindWith(obj, b); err != nil {

examples/grpc/gin/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
defer conn.Close()
2020
client := pb.NewGreeterClient(conn)
2121

22-
// Set up a http setver.
22+
// Set up a http server.
2323
r := gin.Default()
2424
r.GET("/rest/n/:name", func(c *gin.Context) {
2525
name := c.Param("name")

logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func Logger() HandlerFunc {
5353
return LoggerWithWriter(DefaultWriter)
5454
}
5555

56-
// LoggerWithWriter instance a Logger middleware with the specified writter buffer.
56+
// LoggerWithWriter instance a Logger middleware with the specified writer buffer.
5757
// Example: os.Stdout, a file opened in write mode, a socket...
5858
func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
5959
isTerm := true

routergroup.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func (group *RouterGroup) Use(middleware ...HandlerFunc) IRoutes {
5353
return group.returnObj()
5454
}
5555

56-
// Group creates a new router group. You should add all the routes that have common middlwares or the same path prefix.
57-
// For example, all the routes that use a common middlware for authorization could be grouped.
56+
// Group creates a new router group. You should add all the routes that have common middlewares or the same path prefix.
57+
// For example, all the routes that use a common middleware for authorization could be grouped.
5858
func (group *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup {
5959
return &RouterGroup{
6060
Handlers: group.combineHandlers(handlers),

tree_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"testing"
1313
)
1414

15-
// Used as a workaround since we can't compare functions or their addressses
15+
// Used as a workaround since we can't compare functions or their addresses
1616
var fakeHandlerValue string
1717

1818
func fakeHandler(val string) HandlersChain {

0 commit comments

Comments
 (0)