package assign

import "golang.org/x/tools/go/analysis/passes/assign"

Package assign defines an Analyzer that detects useless assignments.

Analyzer assign

assign: check for useless assignments

This checker reports assignments of the form x = x or a[i] = a[i]. These are almost always useless, and even when they aren't they are usually a mistake.

Index

Variables

var Analyzer = &analysis.Analyzer{
	Name:     "assign",
	Doc:      analysisutil.MustExtractDoc(doc, "assign"),
	URL:      "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/assign",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Source Files

assign.go doc.go

Version
v0.9.3
Published
Jun 1, 2023
Platform
js/wasm
Imports
10 packages
Last checked
5 hours ago

Tools for package owners.