Movatterモバイル変換


[0]ホーム

URL:


unusedresult

package
v0.37.0Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License:BSD-3-ClauseImports:12Imported by:327

Details

Repository

cs.opensource.google/go/x/tools

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

View Source
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.

Source Files

View all Source files

Directories

PathSynopsis
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp