Skip to content

Commit ee07bd7

Browse files
committed
docs: improve documentation and testing across the project
- Update comments for `WithSkipper` function to provide detailed documentation on its parameters and return values Signed-off-by: appleboy <[email protected]>
1 parent e4203c4 commit ee07bd7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

options.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ func WithServerErrorLevel(lvl zerolog.Level) Option {
8989
})
9090
}
9191

92-
// WithSkipper set function to skip middleware
93-
// requests with this function returning true will not have their logs written
94-
// Default is nil
92+
// WithSkipper returns an Option that sets the Skipper function in the config.
93+
// The Skipper function determines whether a request should be skipped for logging.
94+
//
95+
// Parameters:
96+
//
97+
// s (Skipper): A function that takes a gin.Context and returns a boolean indicating
98+
// whether the request should be skipped.
99+
//
100+
// Returns:
101+
//
102+
// Option: An option that sets the Skipper function in the config.
95103
func WithSkipper(s Skipper) Option {
96104
return optionFunc(func(c *config) {
97105
c.skip = s

0 commit comments

Comments
 (0)