gorules

package
v0.0.0-...-87e9d67 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package gorules contains ruleguard linter rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UberStyleErrors

func UberStyleErrors(m dsl.Matcher)

UberStyleErrors detects error messages like

errors.Wrap(err, "failed to do something")

but you should avoid "failed to" and use

errors.Wrap(err, "do something")

according to https://github.com/uber-go/guide/blob/master/style.md#error-wrapping.

func UnnecessaryErrorFormat

func UnnecessaryErrorFormat(m dsl.Matcher)

UnnecessaryErrorFormat detects unnecessary error formatting like

errors.New("error")

and suggests instead

errors.New("error")

func ZapPreferNoWith

func ZapPreferNoWith(m dsl.Matcher)

ZapPreferNoWith suggests replace expressions like

l.With(...).Debug("")

to

l.Debug("", ...).

where l is a *zap.Logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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