days
-1
-5
hours
-2
-2
minutes
-3
0
seconds
-4
-5
search
I say, is that a clue?

Revive: An extensible and configurable linter for Go

Jane Elizabeth
Revive Go
© Shutterstock / ostill

No need for extensive deduction to find out where that source code error came from! Solve all your bugs and suspicious constructs with Revive, a fast and configurable linter for Go.

Is your code full of suspicious errors and bugs? Code analysis is easier than ever with Revive. Now, developers don’t need to be Sherlock Holmes to solve this mystery.

Revive is a fast and configurable linter for Go, providing a framework to develop custom rules.  This framework makes it possible for developers to define a specific and custom preset for enhancing their process for development and code review.

While Go already comes with a preexisting linter in golint, Revive offers developers more options for custom control and configuration to make the entire development process easier and faster.

Go is an opinionated language, so it’s no surprise that golint is too. As such, golint isn’t extensible, nor can developers include or exclude specific rules. Plus, failures have a level of confidence in golint, even if they are false negatives.

Revive is a drop-in replacement for golint with a whole bunch of new features and performance enhancements. It’s got all the same great deduction capabilities, but with even more options for developers.

Revive promises that everyone can extend the framework easily with their own custom rules or formatters. It does so by making it possible to pick and choose which rules the linter should follow. Developers can do that by enabling or disabling rules via a configuration file or TOML file. Plus, it provides multiple formatters to customize the output.

Type checking is also optional, since most rules in golint don’t really need type checking, but it does so anyways. So, if type checking is disabled, Revive runs 6x faster than golint. Compared to golint, Revive performs better because it lints the files for each individual rule into a separate goroutine.

Revive

Revive logo by Georgi Serev

SEE ALSO: Top 5 libraries for Go

Where to get Revive

Interested in trying out this linter for Go? Revive is available on GitHub. You can find out more information there and in this article.

Revive is open for external contributions and it’s one of the easiest ways to add new rules into the project.

Author
Jane Elizabeth
Jane Elizabeth is an assistant editor for JAXenter.com.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of