unusedresult
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package unusedresult defines an analyzer that checks for unusedresults of calls to certain pure functions.
Analyzer unusedresult¶
unusedresult: check for unused results of calls to some functions
Some functions like fmt.Errorf return a result and have no sideeffects, so it is always a mistake to discard the result. Otherfunctions may return an error that must not be ignored, or a cleanupoperation that must be called. This analyzer reports calls tofunctions like these when the result of the call is ignored.
The set of functions may be controlled using flags.
Package unusedresult defines an analyzer that checks for unusedresults of calls to certain functions.
Index¶
Constants¶
This section is empty.
Variables¶
var Analyzer = &analysis.Analyzer{Name: "unusedresult",Doc:analysisutil.MustExtractDoc(doc, "unusedresult"),URL: "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/unusedresult",Requires: []*analysis.Analyzer{inspect.Analyzer},Run: run,}
Functions¶
This section is empty.
Types¶
This section is empty.
Directories¶
Path | Synopsis |
---|---|
cmd | |
unusedresultcommand The unusedresult command applies the golang.org/x/tools/go/analysis/passes/unusedresult analysis to the specified packages of Go source code. | The unusedresult command applies the golang.org/x/tools/go/analysis/passes/unusedresult analysis to the specified packages of Go source code. |