package errorcheck

import "github.com/Diarkis/diarkis/analysis/passes/errorcheck"

Package errorcheck defines an analyzer that detects misuse of the Diarkis util package error functions

Analyzer errorcheck

errorcheck: check that there are no misuasages of Diarkis util error functions

We are checking to make sure that the following doesn't happen within error definitions:

Ex: We use %w despite only fmt.Error(f) handling the formtat verb

bad:
	util.NewError("we have an error %w -> return:%s", err, ret)

good:
	util.NewError("we have an error %v -> return:%s", err, ret)

Index

Variables

var Analyzer = &analysis.Analyzer{
	Name:     "errorcheck",
	Doc:      "Checks for misuse of Diarkis util package error functions",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer for errorcheck; checks for misuse of Diarkis util package error functions.

Directories

cmd The errorcheck command applies the github.com/Diarkis/diarkis/analysis/errorcheck analysis to the specified packages of Go source code.