checkers

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiagnosticCategory = "logging"
)

Variables

This section is empty.

Functions

func ExecuteChecker

func ExecuteChecker(c Checker, pass *analysis.Pass, call CallContext, cfg Config)

Types

type CallContext

type CallContext struct {
	Expr      *ast.CallExpr
	Func      *types.Func
	Signature *types.Signature
	File      *ast.File
}

type Checker

type Checker interface {
	FilterKeyAndValues(pass *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr
	CheckLoggingKey(pass *analysis.Pass, keyAndValues []ast.Expr)
	CheckPrintfLikeSpecifier(pass *analysis.Pass, args []ast.Expr)
}

type Config

type Config struct {
	RequireStringKey bool
	NoPrintfLike     bool
}

type General

type General struct{}

func (General) CheckLoggingKey

func (g General) CheckLoggingKey(pass *analysis.Pass, keyAndValues []ast.Expr)

func (General) CheckPrintfLikeSpecifier

func (g General) CheckPrintfLikeSpecifier(pass *analysis.Pass, args []ast.Expr)

func (General) FilterKeyAndValues

func (g General) FilterKeyAndValues(_ *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr

type Zap

type Zap struct {
	General
}

func (Zap) FilterKeyAndValues

func (z Zap) FilterKeyAndValues(pass *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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