Is there a better alternative to `gofmt`?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • SaaSHub - Software Alternatives and Reviews
  • gofumpt

    A stricter gofmt

    I use gofumpt but I'm pretty sure it doesn't wrap either (and I don't want it to so we're good)

  • prettier

    Prettier is an opinionated code formatter.

    For JavaScript I love https://prettier.io/ - is there something similar for Go that provides a stricter and more opinionated formatting?

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.

  • revive

    🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

    Been using https://github.com/mgechev/revive in all my projects.

  • golangci-lint

    Fast linters Runner for Go

    Goimports and revive (golint is deprecated iirc, so stick to revive) are nice. I have been using golangci lint with different linters enabled, which works really well. https://github.com/golangci/golangci-lint

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts