From cc75936e9410f62b06f3c6c2e34fe03d29e91b42 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Fri, 21 Apr 2023 15:55:17 +0800 Subject: [PATCH] fix misuses of a vs an Signed-off-by: cui fliter --- doc.go | 2 +- fs.go | 2 +- gin.go | 10 +++++----- ginS/gins.go | 10 +++++----- routergroup.go | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc.go b/doc.go index 1bd03864..698d3479 100644 --- a/doc.go +++ b/doc.go @@ -1,5 +1,5 @@ /* -Package gin implements a HTTP web framework called gin. +Package gin implements an HTTP web framework called gin. See https://gin-gonic.com/ for more information about gin. */ diff --git a/fs.go b/fs.go index 64274735..af99fc14 100644 --- a/fs.go +++ b/fs.go @@ -17,7 +17,7 @@ type neuteredReaddirFile struct { http.File } -// Dir returns a http.FileSystem that can be used by http.FileServer(). It is used internally +// Dir returns an http.FileSystem that can be used by http.FileServer(). It is used internally // in router.Static(). // if listDirectory == true, then it works the same as http.Dir() otherwise it returns // a filesystem that prevents http.FileServer() to list the directory files. diff --git a/gin.go b/gin.go index f95e5dda..f83f0a79 100644 --- a/gin.go +++ b/gin.go @@ -370,7 +370,7 @@ func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo { return routes } -// Run attaches the router to a http.Server and starts listening and serving HTTP requests. +// Run attaches the router to an http.Server and starts listening and serving HTTP requests. // It is a shortcut for http.ListenAndServe(addr, router) // Note: this method will block the calling goroutine indefinitely unless an error happens. func (engine *Engine) Run(addr ...string) (err error) { @@ -490,7 +490,7 @@ func parseIP(ip string) net.IP { return parsedIP } -// RunTLS attaches the router to a http.Server and starts listening and serving HTTPS (secure) requests. +// RunTLS attaches the router to an http.Server and starts listening and serving HTTPS (secure) requests. // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router) // Note: this method will block the calling goroutine indefinitely unless an error happens. func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) { @@ -506,7 +506,7 @@ func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) { return } -// RunUnix attaches the router to a http.Server and starts listening and serving HTTP requests +// RunUnix attaches the router to an http.Server and starts listening and serving HTTP requests // through the specified unix socket (i.e. a file). // Note: this method will block the calling goroutine indefinitely unless an error happens. func (engine *Engine) RunUnix(file string) (err error) { @@ -529,7 +529,7 @@ func (engine *Engine) RunUnix(file string) (err error) { return } -// RunFd attaches the router to a http.Server and starts listening and serving HTTP requests +// RunFd attaches the router to an http.Server and starts listening and serving HTTP requests // through the specified file descriptor. // Note: this method will block the calling goroutine indefinitely unless an error happens. func (engine *Engine) RunFd(fd int) (err error) { @@ -551,7 +551,7 @@ func (engine *Engine) RunFd(fd int) (err error) { return } -// RunListener attaches the router to a http.Server and starts listening and serving HTTP requests +// RunListener attaches the router to an http.Server and starts listening and serving HTTP requests // through the specified net.Listener func (engine *Engine) RunListener(listener net.Listener) (err error) { debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr()) diff --git a/ginS/gins.go b/ginS/gins.go index ea38c613..e7ba0722 100644 --- a/ginS/gins.go +++ b/ginS/gins.go @@ -104,7 +104,7 @@ func StaticFile(relativePath, filepath string) gin.IRoutes { } // Static serves files from the given file system root. -// Internally a http.FileServer is used, therefore http.NotFound is used instead +// Internally an http.FileServer is used, therefore http.NotFound is used instead // of the Router's NotFound handler. // To use the operating system's file system implementation, // use : @@ -131,28 +131,28 @@ func Routes() gin.RoutesInfo { return engine().Routes() } -// Run attaches to a http.Server and starts listening and serving HTTP requests. +// Run attaches to an http.Server and starts listening and serving HTTP requests. // It is a shortcut for http.ListenAndServe(addr, router) // Note: this method will block the calling goroutine indefinitely unless an error happens. func Run(addr ...string) (err error) { return engine().Run(addr...) } -// RunTLS attaches to a http.Server and starts listening and serving HTTPS requests. +// RunTLS attaches to an http.Server and starts listening and serving HTTPS requests. // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router) // Note: this method will block the calling goroutine indefinitely unless an error happens. func RunTLS(addr, certFile, keyFile string) (err error) { return engine().RunTLS(addr, certFile, keyFile) } -// RunUnix attaches to a http.Server and starts listening and serving HTTP requests +// RunUnix attaches to an http.Server and starts listening and serving HTTP requests // through the specified unix socket (i.e. a file) // Note: this method will block the calling goroutine indefinitely unless an error happens. func RunUnix(file string) (err error) { return engine().RunUnix(file) } -// RunFd attaches the router to a http.Server and starts listening and serving HTTP requests +// RunFd attaches the router to an http.Server and starts listening and serving HTTP requests // through the specified file descriptor. // Note: the method will block the calling goroutine indefinitely unless on error happens. func RunFd(fd int) (err error) { diff --git a/routergroup.go b/routergroup.go index c833fe8f..cc8b3c92 100644 --- a/routergroup.go +++ b/routergroup.go @@ -188,7 +188,7 @@ func (group *RouterGroup) staticFileHandler(relativePath string, handler Handler } // Static serves files from the given file system root. -// Internally a http.FileServer is used, therefore http.NotFound is used instead +// Internally an http.FileServer is used, therefore http.NotFound is used instead // of the Router's NotFound handler. // To use the operating system's file system implementation, // use :