From 1c32036e7ea465955794e7f598c6beb6278ada97 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 13 Sep 2020 10:58:14 +1000 Subject: [PATCH] Fix spelling and grammar (#193) --- README.md | 4 ++-- cache/redis.go | 2 +- commonlog/commonlog.go | 2 +- sessions/sessions.go | 2 +- static/example/bindata/bindata.go | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a524506..f128340 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If adding a link to your own repository, please follow this example: + nameOfMiddleware (https://github.com/yourusername/yourrepo) ``` -Each author is responsible of maintaining his own code, although if you submit as a package, you allow the community to fix it. You can also submit a pull request to fix an existing package. +Each author is responsible for maintaining their own code, although if you submit as a package, you allow the community to fix it. You can also submit a pull request to fix an existing package. ## List of external middleware @@ -25,7 +25,7 @@ Each author is responsible of maintaining his own code, although if you submit a + [gin-jwt](https://github.com/appleboy/gin-jwt) - JWT Middleware for Gin Framework + [gin-sessions](https://github.com/kimiazhu/ginweb-contrib/tree/master/sessions) - session middleware based on mongodb and mysql + [gin-location](https://github.com/drone/gin-location) - middleware for exposing the server's hostname and scheme -+ [gin-nice-recovery](https://github.com/ekyoung/gin-nice-recovery) - panic recovery middleware that let's you build a nicer user experience ++ [gin-nice-recovery](https://github.com/ekyoung/gin-nice-recovery) - panic recovery middleware that lets you build a nicer user experience + [gin-limiter](https://github.com/davidleitw/gin-limiter) - A simple gin middleware for ip limiter based on redis. + [gin-limit](https://github.com/aviddiviner/gin-limit) - limits simultaneous requests; can help with high traffic load + [gin-limit-by-key](https://github.com/yangxikun/gin-limit-by-key) - An in-memory middleware to limit access rate by custom key and rate. diff --git a/cache/redis.go b/cache/redis.go index c1c5d61..c2b0220 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -104,7 +104,7 @@ func (c *RedisStore) Delete(key string) error { func (c *RedisStore) Increment(key string, delta uint64) (uint64, error) { conn := c.pool.Get() defer conn.Close() - // Check for existance *before* increment as per the cache contract. + // Check for existence *before* increment as per the cache contract. // redis will auto create the key, and we don't want that. Since we need to do increment // ourselves instead of natively via INCRBY (redis doesn't support wrapping), we get the value // and do the exists check this way to minimize calls to Redis diff --git a/commonlog/commonlog.go b/commonlog/commonlog.go index 753110b..d8275a1 100644 --- a/commonlog/commonlog.go +++ b/commonlog/commonlog.go @@ -16,7 +16,7 @@ func New() gin.HandlerFunc { return NewWithWriter(gin.DefaultWriter) } -// Instance a Logger middleware with the specified writter buffer. +// Instance a Logger middleware with the specified writer buffer. // Example: os.Stdout, a file opened in write mode, a socket... func NewWithWriter(out io.Writer) gin.HandlerFunc { pool := &sync.Pool{ diff --git a/sessions/sessions.go b/sessions/sessions.go index ca26513..06d5b3b 100644 --- a/sessions/sessions.go +++ b/sessions/sessions.go @@ -51,7 +51,7 @@ type Session interface { // A single variadic argument is accepted, and it is optional: it defines the flash key. // If not defined "_flash" is used by default. Flashes(vars ...string) []interface{} - // Options sets confuguration for a session. + // Options sets configuration for a session. Options(Options) // Save saves all sessions used during the current request. Save() error diff --git a/static/example/bindata/bindata.go b/static/example/bindata/bindata.go index f3b3e2d..d533dde 100644 --- a/static/example/bindata/bindata.go +++ b/static/example/bindata/bindata.go @@ -51,8 +51,8 @@ func data_index_html() ([]byte, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { return f() } return nil, fmt.Errorf("Asset %s not found", name) @@ -85,8 +85,8 @@ var _bindata = map[string]func() ([]byte, error){ // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error func AssetDir(name string) ([]string, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") node := _bintree for _, p := range pathList { node = node.Children[p]