mirror of https://github.com/gin-gonic/gin.git
fix misuses of a vs an
Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
parent
a889c58de7
commit
cc75936e94
2
doc.go
2
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.
|
||||
*/
|
||||
|
|
2
fs.go
2
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.
|
||||
|
|
10
gin.go
10
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())
|
||||
|
|
10
ginS/gins.go
10
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) {
|
||||
|
|
|
@ -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 :
|
||||
|
|
Loading…
Reference in New Issue