Plural is "Paths", not "Pathes" (#1706)

This commit is contained in:
Sai 2018-12-20 18:54:08 +09:00 committed by thinkerou
parent 1542eff27f
commit 678e09c736
2 changed files with 7 additions and 7 deletions

View File

@ -35,9 +35,9 @@ type LoggerConfig struct {
// Optional. Default value is gin.DefaultWriter. // Optional. Default value is gin.DefaultWriter.
Output io.Writer Output io.Writer
// SkipPathes is a url path array which logs are not written. // SkipPaths is a url path array which logs are not written.
// Optional. // Optional.
SkipPathes []string SkipPaths []string
} }
// LogFormatter gives the signature of the formatter function passed to LoggerWithFormatter // LogFormatter gives the signature of the formatter function passed to LoggerWithFormatter
@ -114,8 +114,8 @@ func LoggerWithFormatter(f LogFormatter) HandlerFunc {
// Example: os.Stdout, a file opened in write mode, a socket... // Example: os.Stdout, a file opened in write mode, a socket...
func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
return LoggerWithConfig(LoggerConfig{ return LoggerWithConfig(LoggerConfig{
Output: out, Output: out,
SkipPathes: notlogged, SkipPaths: notlogged,
}) })
} }
@ -131,7 +131,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
out = DefaultWriter out = DefaultWriter
} }
notlogged := conf.SkipPathes notlogged := conf.SkipPaths
isTerm := true isTerm := true

View File

@ -320,8 +320,8 @@ func TestLoggerWithConfigSkippingPaths(t *testing.T) {
buffer := new(bytes.Buffer) buffer := new(bytes.Buffer)
router := New() router := New()
router.Use(LoggerWithConfig(LoggerConfig{ router.Use(LoggerWithConfig(LoggerConfig{
Output: buffer, Output: buffer,
SkipPathes: []string{"/skipped"}, SkipPaths: []string{"/skipped"},
})) }))
router.GET("/logged", func(c *Context) {}) router.GET("/logged", func(c *Context) {})
router.GET("/skipped", func(c *Context) {}) router.GET("/skipped", func(c *Context) {})