Skip to content

JRBANCEL/Linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card License: MIT

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]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages