Skip to content

Commit

Permalink
Fix typos (gin-gonic#1626)
Browse files Browse the repository at this point in the history
jbampton authored and thinkerou committed Nov 5, 2018
1 parent 4f488ac commit 7a374f9
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion binding/binding.go
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion binding/protobuf.go
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion examples/grpc/gin/main.go
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions routergroup.go
Original file line number Diff line number Diff line change
@@ -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),
2 changes: 1 addition & 1 deletion tree_test.go
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 7a374f9

Please sign in to comment.