namedreturn

package module
v0.0.0-...-467ff63 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: MIT Imports: 6 Imported by: 0

README

namedreturn

DO NOT use named return values in Go

namedreturn finds a named return value, you must remove it.

package a

func _()                {}              // OK
func _() int            { return 1 }    // OK
func _() (int, int)     { return 1, 1 } // OK
func _() (a int)        { return 1 }    // want "a is named return value"
func _() (a int, b int) { return 1, 1 } // want "a is named return value" "b is named return value"
func _() (a, b int)     { return 1, 1 } // want "a is named return value" "b is named return value"

Installation

go install github.com/thara/namedreturn/cmd/namedreturn@latest

Usage

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

Author

Tomochika Hara (a.k.a thara)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "namedreturn",
	Doc:  doc,
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
}

Analyzer is ...

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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