toolshonnef.co/go/tools/simple/s1005 Index | Files

package s1005

import "honnef.co/go/tools/simple/s1005"

Index

Variables

var Analyzer = SCAnalyzer.Analyzer
var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{
	Analyzer: &analysis.Analyzer{
		Name:     "S1005",
		Run:      run,
		Requires: []*analysis.Analyzer{inspect.Analyzer, generated.Analyzer},
	},
	Doc: &lint.RawDocumentation{
		Title: `Drop unnecessary use of the blank identifier`,
		Text:  `In many cases, assigning to the blank identifier is unnecessary.`,
		Before: `
for _ = range s {}
x, _ = someMap[key]
_ = <-ch`,
		After: `
for range s{}
x = someMap[key]
<-ch`,
		Since:   "2017.1",
		MergeIf: lint.MergeIfAny,
	},
})

Source Files

s1005.go

Version
v0.6.1 (latest)
Published
Mar 5, 2025
Platform
js/wasm
Imports
11 packages
Last checked
3 hours ago

Tools for package owners.