Skip to content

Commit 830a63d

Browse files
authored
fix: typo (gin-gonic#2973)
* fix: typo * fix: grammar error
1 parent bc2417f commit 830a63d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

gin.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func (engine *Engine) allocateContext() *Context {
205205
return &Context{engine: engine, params: &v, skippedNodes: &skippedNodes}
206206
}
207207

208-
// Delims sets template left and right delims and returns a Engine instance.
208+
// Delims sets template left and right delims and returns an Engine instance.
209209
func (engine *Engine) Delims(left, right string) *Engine {
210210
engine.delims = render.Delims{Left: left, Right: right}
211211
return engine
@@ -259,7 +259,7 @@ func (engine *Engine) SetFuncMap(funcMap template.FuncMap) {
259259
engine.FuncMap = funcMap
260260
}
261261

262-
// NoRoute adds handlers for NoRoute. It return a 404 code by default.
262+
// NoRoute adds handlers for NoRoute. It returns a 404 code by default.
263263
func (engine *Engine) NoRoute(handlers ...HandlerFunc) {
264264
engine.noRoute = handlers
265265
engine.rebuild404Handlers()
@@ -271,7 +271,7 @@ func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
271271
engine.rebuild405Handlers()
272272
}
273273

274-
// Use attaches a global middleware to the router. ie. the middleware attached through Use() will be
274+
// Use attaches a global middleware to the router. i.e. the middleware attached through Use() will be
275275
// included in the handlers chain for every single request. Even 404, 405, static files...
276276
// For example, this is the right place for a logger or error management middleware.
277277
func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes {
@@ -442,7 +442,7 @@ func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) {
442442
}
443443

444444
// RunUnix attaches the router to a http.Server and starts listening and serving HTTP requests
445-
// through the specified unix socket (ie. a file).
445+
// through the specified unix socket (i.e. a file).
446446
// Note: this method will block the calling goroutine indefinitely unless an error happens.
447447
func (engine *Engine) RunUnix(file string) (err error) {
448448
debugPrint("Listening and serving HTTP on unix:/%s", file)

logger.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type LogFormatterParams struct {
7070
Path string
7171
// ErrorMessage is set if error has occurred in processing the request.
7272
ErrorMessage string
73-
// isTerm shows whether does gin's output descriptor refers to a terminal.
73+
// isTerm shows whether gin's output descriptor refers to a terminal.
7474
isTerm bool
7575
// BodySize is the size of the Response Body
7676
BodySize int
@@ -178,7 +178,7 @@ func ErrorLoggerT(typ ErrorType) HandlerFunc {
178178
}
179179

180180
// Logger instances a Logger middleware that will write the logs to gin.DefaultWriter.
181-
// By default gin.DefaultWriter = os.Stdout.
181+
// By default, gin.DefaultWriter = os.Stdout.
182182
func Logger() HandlerFunc {
183183
return LoggerWithConfig(LoggerConfig{})
184184
}

recovery.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func function(pc uintptr) []byte {
155155
// runtime/debug.*T·ptrmethod
156156
// and want
157157
// *T.ptrmethod
158-
// Also the package path might contains dot (e.g. code.google.com/...),
158+
// Also the package path might contain dot (e.g. code.google.com/...),
159159
// so first eliminate the path prefix
160160
if lastSlash := bytes.LastIndex(name, slash); lastSlash >= 0 {
161161
name = name[lastSlash+1:]

0 commit comments

Comments
 (0)