gorules

package
v0.56.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 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 added in v0.50.0

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 added in v0.50.0

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