go-nobadfuncs

command module
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

Autorelease

go-nobadfuncs

go-nobadfuncs verifies that a set of specified functions are not referenced in the packages being checked. It can be used to deny specific functions that should not typically be referenced or called. It is possible to explicitly allow uses of deny-listed functions by adding a comment to the line before the calling line.

Usage

go-nobadfuncs takes the path to the packages that should be checked for function calls. It also takes configuration (as JSON) that specifies the blacklisted functions.

The function signatures that are blacklisted are full function signatures consisting of the fully qualified package name or receiver, name, parameter types and return types. Examples:

func (*net/http.Client).Do(*net/http.Request) (*net/http.Response, error)
func fmt.Println(...interface{}) (int, error)

go-nobadfuncs can be run with the following flags:

  • --print-all flag to print all of the function references in the provided packages. The output can be used as the basis for determining the signatures for blacklist functions.
  • --config-json flag to run with the JSON configuration for the check

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package integration contains the integration tests for nobadfuncs.
Package integration contains the integration tests for nobadfuncs.

Jump to

Keyboard shortcuts

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