goreturncount

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

goreturncount

Find functions that have too many return values.

Motivation

Functions with many return values can be difficult to understand and the order of the values may be confusing. Also, having many return values can be an indication that the function is doing too many things. If you really need to return 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/goreturncount

Usage

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

$ goreturncount ./...

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

$ goreturncount -max 3 ./...

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

$ goreturncount -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