linter

module
v0.0.0-...-b037441 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT

README

Go Report Card

What?

A linter replacing variadic formatting functions with their non variadic equivalent, example:

fmt.Printf("Some error: %v", err) becomes fmt.Print("Some error: ", err)

There are some interesting edge cases, for example testing.T.Fatal behaves differently than log.Fatal because the former calls fmt.Sprintln while the latter fmt.Sprint.

Why?

The main reason is for consistency across a code base.

Also, variadic functions are very marginally faster: see benchmark.

Use

To display the errors:

linter [path to directory containing Go package]

To fix the file in place (make sure to have a backup of the files):

linter -w [path to directory containing Go package]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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