Skip to content

✍️ A linter that reports interfaces with unnamed method parameters

License

Notifications You must be signed in to change notification settings

macabu/inamedparam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cb15a18 · Mar 15, 2025

History

17 Commits
Mar 15, 2025
Apr 22, 2023
Mar 15, 2025
Dec 17, 2023
Mar 15, 2025
Apr 22, 2023
Mar 15, 2025
Mar 15, 2025
Mar 15, 2025
Mar 15, 2025
Mar 15, 2025

Repository files navigation

inamedparam

A linter that reports interfaces with unnamed method parameters.

Flags/Config

-skip-single-param
    skip interfaces with a single unnamed parameter

Usage

Standalone

You can run it standalone through go vet.

You must install the binary to your $GOBIN folder like so:

$ go install github.com/macabu/inamedparam/cmd/inamedparam@latest

And then navigate to your Go project's root folder, where can run go vet in the following way:

$ go vet -vettool=$(which inamedparam) ./...

golangci-lint

inamedparam was added as a linter to golangci-lint on version v1.55.0. It is disabled by default.

To enable it, you can add it to your .golangci.yml file, as such:

run:
  timeout: 30s 

linters:
  disable-all: true
  enable:
    - inamedparam

linters-settings:
  inamedparam:
    # Skips check for interface methods with only a single parameter.
    # Default: false
    skip-single-param: true