🎨 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
nickajacks1 2024-02-10 13:36:49 -08:00 committed by GitHub
parent 573afb953d
commit 92dd8d6917
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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
View File

@ -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

View File

@ -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.