Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Use ExactString() because String() returns shortened string if the
value is long

Git stats


Failed to load latest commit information.

err113 GoDoc Build Status Coverage Status

Table of Contents

Golang linter to check the errors handling expressions


Starting from Go 1.13 the standard error type behaviour was changed: one error could be derived from another with fmt.Errorf() method using %w format specifier.

So the errors hierarchy could be built for flexible and responsible errors processing.

And to make this possible at least two simple rules should be followed:

  1. error values should not be compared directly but with errors.Is() method.

  2. error should not be created dynamically from scratch but by the wrapping the static (package-level) error.

This linter is checking the code for these 2 rules compliance.


So, err113 reports every == and != comparison for exact error type variables except comparison to nil and io.EOF.

Also, any call of errors.New() and fmt.Errorf() methods are reported except the calls used to initialise package-level variables and the fmt.Errorf() calls wrapping the other errors.

Note: non-standard packages, like are ignored completely.


go get -u


Defined by singlechecker package.

err113: checks the error handling rules according to the Go 1.13 new error type

Usage: err113 [-flag] [package]

  -V	print version and exit
    	no effect (deprecated)
  -c int
    	display offending line with this many lines of context (default -1)
  -cpuprofile string
    	write CPU profile to this file
  -debug string
    	debug flags, any subset of "fpstv"
    	apply all suggested fixes
    	print analyzer flags in JSON
    	emit JSON output
  -memprofile string
    	write memory profile to this file
    	no effect (deprecated)
  -tags string
    	no effect (deprecated)
  -trace string
    	write trace log to this file
  -v	no effect (deprecated)


To Iskander (Alex) Sharipov for the really useful advices.

To Jack Whelpton for the bugfix provided.