Skip to content

Commit

Permalink
🎨 Style: Add inamedparam linter (#2848)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nickajacks1 committed Feb 10, 2024
1 parent 573afb9 commit 92dd8d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 92dd8d6

Please sign in to comment.