Documentation ¶
Overview ¶
Package uncalled defines an Analyzer that checks for missing calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAnalyzer ¶
NewAnalyzer returns a new Analyzer configured with options that checks for missing calls.
Types ¶
type Config ¶
type Config struct {
Rules []Rule
}
Config represents the configuration for uncalled Analyzer.
type Expect ¶
type Expect struct { Method string ResultIndex int `yaml:"result-index" mapstructure:"result-index"` Args []string }
Expect is the expected call for a Rule.
type Option ¶
type Option func(*analyzer) error
Option represents an Analyzer option.
func ConfigFile ¶
ConfigFile is an Analyzer option which loads its config from file. Default: embedded config.
func ConfigOpt ¶
ConfigOpt is an Analyzer option which specifies the config to use. Default: embedded config.
func LogLevel ¶ added in v0.5.0
LogLevel is an Analyzer option which configures its log level. Default: info.
func TestWriter ¶ added in v0.5.0
func TestWriter(t zerolog.TestingLog) Option
TestWriter is an Analyzer option which configures its log to use t. Default: os.Stderr.
type Result ¶
type Result struct { // Type is name of the type. // If "_" then matches any type. // If prefixed by "." then matches any type of specified // in its Rule.Packages. Type string // Pointer specifies if this type should be a pointer to // the named TypeName. Pointer bool // contains filtered or unexported fields }
Result is a result expected from a rule call.