empty_err_checker

package module
v0.0.0-...-c0c174c Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 5 Imported by: 2

README

empty_err_checker

Test

empty_err_checker is checking whether the return value 'err' is nil.

example

func inValidErrChecker() error {
	var err error
	isValid := isValid()
	if !isValid {
		return err // report this return err as invalid
	}
	return nil
}

Check the test code for detailed detection examples.

Installation

go install github.com/snkrdunk/empty_err_checker/cmd/empty_err_checker@latest

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "empty_err_checker",
	Doc:  "empty_err_checker is checking whether the return value 'err' is nil.",
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
}

Functions

func New

func New(settings any) (register.LinterPlugin, error)

Types

type PluginImpl

type PluginImpl struct{}

func (*PluginImpl) BuildAnalyzers

func (f *PluginImpl) BuildAnalyzers() ([]*analysis.Analyzer, error)

func (*PluginImpl) GetLoadMode

func (f *PluginImpl) GetLoadMode() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳