mapkeyexistscheck

package module
v0.0.0-...-722b13c Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 3 Imported by: 0

README

mapkeyexistscheck

mapkeyexistscheck is a lint program that enforces checking for the existence of a key when accessing a map.

Install

go install github.com/resessh/mapkeyexistscheck/cmd/mapkeyexistscheck@latest

Usage

package main

func main()  {
  m := map[int]string{
    1: "1",
  }

  val := m[2]

  // ...
}
$ go vet -vettool=(which mapkeyexistscheck) ./...

main.go:8:2: map key exists check is not performed

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "mapkeyexistscheck",
	Doc:  "checking an existence check is being performed when accessing a map",
	Run:  run,
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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