From b8a7b6d1945db03a70de86c5837caa93486d1f99 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 7 Jan 2020 11:19:49 +1000 Subject: [PATCH] Fix spelling (#2202) --- CHANGELOG.md | 4 ++-- context.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bb90f22..1ceb919c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -196,7 +196,7 @@ - [PERFORMANCE] Misc code optimizations. Inlining, tail call optimizations - [NEW] Built-in support for golang.org/x/net/context - [NEW] Any(path, handler). Create a route that matches any path -- [NEW] Refactored rendering pipeline (faster and static typeded) +- [NEW] Refactored rendering pipeline (faster and static typed) - [NEW] Refactored errors API - [NEW] IndentedJSON() prints pretty JSON - [NEW] Added gin.DefaultWriter @@ -295,7 +295,7 @@ - [FIX] Recovery() middleware only prints panics - [FIX] Context.Get() does not panic anymore. Use MustGet() instead. - [FIX] Multiple http.WriteHeader() in NotFound handlers -- [FIX] Engine.Run() panics if http server can't be setted up +- [FIX] Engine.Run() panics if http server can't be set up - [FIX] Crash when route path doesn't start with '/' - [FIX] Do not update header when status code is negative - [FIX] Setting response headers before calling WriteHeader in context.String() diff --git a/context.go b/context.go index 046f284e..9be222fc 100644 --- a/context.go +++ b/context.go @@ -1003,20 +1003,20 @@ func (c *Context) NegotiateFormat(offered ...string) string { return offered[0] } for _, accepted := range c.Accepted { - for _, offert := range offered { + for _, offer := range offered { // According to RFC 2616 and RFC 2396, non-ASCII characters are not allowed in headers, // therefore we can just iterate over the string without casting it into []rune i := 0 for ; i < len(accepted); i++ { - if accepted[i] == '*' || offert[i] == '*' { - return offert + if accepted[i] == '*' || offer[i] == '*' { + return offer } - if accepted[i] != offert[i] { + if accepted[i] != offer[i] { break } } if i == len(accepted) { - return offert + return offer } } }