goparamcount

command
v0.0.0-...-ae5582a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 14 Imported by: 0

README

goparamcount

Find functions that have too many parameters.

Motivation

Functions with many parameters can be difficult to understand and the order of parameters may be confusing. Also, having many parameters can be an indication that the function is doing too many things. And, if you really need a lot of data it may be a better idea to wrap it in a struct anyway.

Installation

$ go get github.com/ericcornelissen/gofunchecks/cmd/goparamcount

Usage

For basic usage, run the following command from the root of your project:

$ goparamcount ./...

Which will analyze all packages beneath the current directory. If you want to change the number of parameters that is allowed you can use the -max flag:

$ goparamcount -max 3 ./...

You can specify the maximum number of parameters separately for public and private functions using the -public-max and -private-max flags:

$ goparamcount -public-max 2 -private-max 4 ./...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL