errstringcheck

package module
v0.0.0-...-6ec7001 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 9 Imported by: 0

README

errstringcheck

errstringcheck checks error message format.

Install

go install github.com/fmatzy/errstringcheck/cmd/errstringcheck@latest

Usage

errstringcheck ./...

Examples

// Bad
fmt.Errof("foo error=%v", err)
fmt.Errof("bar error=%w", err)
fmt.Errof("error %w message", err)

// Good
fmt.Errof("foo error: %v", err)
fmt.Errof("bar error: %w", err)

Options

  • -wraponly: Only allow %w verb to format error variable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzer

func NewAnalyzer() *analysis.Analyzer

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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