mapdeletecheck

package
v0.82.10 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mapdeletecheck implements a Go analysis linter that flags redundant map membership checks before a delete call such as "if _, ok := m[k]; ok { delete(m, k) }" which can be simplified to "delete(m, k)" since delete is a no-op for missing keys.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "mapdeletecheck",
	Doc:      "reports redundant map membership checks before delete(m, k) calls since delete is already a no-op for missing keys",
	URL:      "https://github.com/github/gh-aw/tree/main/pkg/linters/mapdeletecheck",
	Requires: []*analysis.Analyzer{inspect.Analyzer, nolint.Analyzer, filecheck.Analyzer},
	Run:      run,
}

Analyzer is the map-delete-check analysis pass.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL