Skip to content
/ delrange Public

The static analysis tool which detects delete function is called with a value different from the range key.

License

Notifications You must be signed in to change notification settings

p1ass/delrange

Repository files navigation

delrange

delrange is a static analysis tool which detects delete function is called with a value different from range key.

test_and_lint Go Report Card

Features

  • Detect delete function is called with a value different from range key.

Example

package main

import "fmt"

func main() {
	m := map[int]int{1: 1, 2: 2}
	for key, value := range m {
		delete(m, 1) // want "function is called with a value different from range key"
		delete(m, key)
		fmt.Println(key, value)
	}
}

Installation

go get

GO111MODULE=off go get github.com/p1ass/delrange/cmd/delrange

Usage

go vet -vettool=`which delrange` ./...

About

The static analysis tool which detects delete function is called with a value different from the range key.

Topics

Resources

License

Stars

Watchers

Forks

Languages