Documentation ¶
Overview ¶
Package fillreturns defines an Analyzer that will attempt to automatically fill in a return statement that has missing values with zero value elements.
Analyzer fillreturns ¶
fillreturns: suggest fixes for errors due to an incorrect number of return values
This checker provides suggested fixes for type errors of the type "wrong number of return values (want %d, got %d)". For example:
func m() (int, string, *bool, error) { return }
will turn into
func m() (int, string, *bool, error) { return 0, "", nil, nil }
This functionality is similar to https://github.com/sqs/goreturns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "fillreturns", Doc: analysisinternal.MustExtractDoc(doc, "fillreturns"), Run: run, RunDespiteErrors: true, URL: "https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/fillreturns", }
Functions ¶
func FixesError ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.