fix misuses of a vs an

Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
cui fliter 2023-04-21 15:55:17 +08:00
parent a889c58de7
commit cc75936e94
5 changed files with 13 additions and 13 deletions

2
doc.go
View File

@ -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. See https://gin-gonic.com/ for more information about gin.
*/ */

2
fs.go
View File

@ -17,7 +17,7 @@ type neuteredReaddirFile struct {
http.File 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(). // in router.Static().
// if listDirectory == true, then it works the same as http.Dir() otherwise it returns // 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. // a filesystem that prevents http.FileServer() to list the directory files.

10
gin.go
View File

@ -370,7 +370,7 @@ func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {
return routes 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) // It is a shortcut for http.ListenAndServe(addr, router)
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func (engine *Engine) Run(addr ...string) (err error) { func (engine *Engine) Run(addr ...string) (err error) {
@ -490,7 +490,7 @@ func parseIP(ip string) net.IP {
return parsedIP 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) // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func (engine *Engine) RunTLS(addr, certFile, keyFile string) (err error) { 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 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). // through the specified unix socket (i.e. a file).
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func (engine *Engine) RunUnix(file string) (err error) { func (engine *Engine) RunUnix(file string) (err error) {
@ -529,7 +529,7 @@ func (engine *Engine) RunUnix(file string) (err error) {
return 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. // through the specified file descriptor.
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func (engine *Engine) RunFd(fd int) (err error) { func (engine *Engine) RunFd(fd int) (err error) {
@ -551,7 +551,7 @@ func (engine *Engine) RunFd(fd int) (err error) {
return 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 // through the specified net.Listener
func (engine *Engine) RunListener(listener net.Listener) (err error) { func (engine *Engine) RunListener(listener net.Listener) (err error) {
debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr()) debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr())

View File

@ -104,7 +104,7 @@ func StaticFile(relativePath, filepath string) gin.IRoutes {
} }
// Static serves files from the given file system root. // 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. // of the Router's NotFound handler.
// To use the operating system's file system implementation, // To use the operating system's file system implementation,
// use : // use :
@ -131,28 +131,28 @@ func Routes() gin.RoutesInfo {
return engine().Routes() 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) // It is a shortcut for http.ListenAndServe(addr, router)
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func Run(addr ...string) (err error) { func Run(addr ...string) (err error) {
return engine().Run(addr...) 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) // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func RunTLS(addr, certFile, keyFile string) (err error) { func RunTLS(addr, certFile, keyFile string) (err error) {
return engine().RunTLS(addr, certFile, keyFile) 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) // through the specified unix socket (i.e. a file)
// Note: this method will block the calling goroutine indefinitely unless an error happens. // Note: this method will block the calling goroutine indefinitely unless an error happens.
func RunUnix(file string) (err error) { func RunUnix(file string) (err error) {
return engine().RunUnix(file) 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. // through the specified file descriptor.
// Note: the method will block the calling goroutine indefinitely unless on error happens. // Note: the method will block the calling goroutine indefinitely unless on error happens.
func RunFd(fd int) (err error) { func RunFd(fd int) (err error) {

View File

@ -188,7 +188,7 @@ func (group *RouterGroup) staticFileHandler(relativePath string, handler Handler
} }
// Static serves files from the given file system root. // 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. // of the Router's NotFound handler.
// To use the operating system's file system implementation, // To use the operating system's file system implementation,
// use : // use :