DEV Community

Cover image for Improve the Go code with GolangCI-Lint
Renato Suero
Renato Suero

Posted on

2 3

Improve the Go code with GolangCI-Lint

It is a great tool to run before you send your commit to the repository(maybe you can use git hook).

there is another option gometalinter but golangci-lint is faster than gometalinter.

GitHub logo golangci / golangci-lint

Fast linters runner for Go

golangci-lint logo

golangci-lint

Fast linters runner for Go


golangci-lint is a fast Go linters runner.

It runs linters in parallel, uses caching, supports YAML configuration, integrates with all major IDEs, and includes over a hundred linters.

Install golangci-lint

Documentation

Documentation is hosted at https://golangci-lint.run.

Social Networks

Join Slack Follow on Mastodon Follow on Bluesky Follow on Twitter

Supporting Us

Open Collective backers and sponsors GitHub Sponsors Linter Authors

golangci-lint is a free and open-source project built by volunteers.

If you value it, consider supporting us, we appreciate it! ❤️

Badges

Build Status License Release Docker GitHub Releases Stats of golangci-lint

Contributors

This project exists thanks to all the people who contribute. How to contribute.

Stargazers over time

Stargazers over time






To run the tools is pretty simple, you need to run:

golangci-lint run ./...
Enter fullscreen mode Exit fullscreen mode

If you want to use docker, the only thing you need to do is configure the volume to use your project path.

docker run --rm -it -v $GOPATH/src/github.com/golangci/golangci-lint:/go/src/github.com/golangci/golangci-lint golangci-lint run ./...
Enter fullscreen mode Exit fullscreen mode

that's all folks, I hope it can be useful to you =)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay