mirror of https://github.com/gofiber/fiber.git
🎨 Style: Add inamedparam linter (#2848)
inamedparam enforces that parameters in interface definitions be named. This is important for clarity so that users and implementers can easily understand the purpose of each parameter.pull/2849/head^2
parent
573afb953d
commit
92dd8d6917
|
@ -191,7 +191,7 @@ linters:
|
|||
# - gosmopolitan # TODO https://github.com/gofiber/fiber/issues/2816
|
||||
- govet
|
||||
- grouper
|
||||
# - inamedparam # TODO https://github.com/gofiber/fiber/issues/2816
|
||||
- inamedparam
|
||||
- loggercheck
|
||||
# - mirror # TODO https://github.com/gofiber/fiber/issues/2816
|
||||
- misspell
|
||||
|
|
4
bind.go
4
bind.go
|
@ -9,13 +9,13 @@ import (
|
|||
type CustomBinder interface {
|
||||
Name() string
|
||||
MIMETypes() []string
|
||||
Parse(Ctx, any) error
|
||||
Parse(c Ctx, out any) error
|
||||
}
|
||||
|
||||
// An interface to register custom struct validator for binding.
|
||||
type StructValidator interface {
|
||||
Engine() any
|
||||
ValidateStruct(any) error
|
||||
ValidateStruct(out any) error
|
||||
}
|
||||
|
||||
// Bind struct
|
||||
|
|
2
ctx.go
2
ctx.go
|
@ -105,7 +105,7 @@ type Cookie struct {
|
|||
// Views is the interface that wraps the Render function.
|
||||
type Views interface {
|
||||
Load() error
|
||||
Render(io.Writer, string, any, ...string) error
|
||||
Render(out io.Writer, name string, binding any, layout ...string) error
|
||||
}
|
||||
|
||||
// ResFmt associates a Content Type to a fiber.Handler for c.Format
|
||||
|
|
|
@ -54,8 +54,8 @@ type CommonLogger interface {
|
|||
|
||||
// ControlLogger provides methods to config a logger.
|
||||
type ControlLogger interface {
|
||||
SetLevel(Level)
|
||||
SetOutput(io.Writer)
|
||||
SetLevel(level Level)
|
||||
SetOutput(w io.Writer)
|
||||
}
|
||||
|
||||
// AllLogger is the combination of Logger, FormatLogger, CtxLogger and ControlLogger.
|
||||
|
|
Loading…
Reference in New Issue