goimports-reviser – Sort and Format Go Imports

goimports-reviser is a command-line tool for organising imports in Go source code according to configurable grouping rules. It distinguishes standard-library imports from general dependencies, project dependencies, and optional company-specific packages, giving projects more control over import layout than a simple alphabetical pass.

The program can also perform source formatting, allowing import organisation and code cleanup to be combined in one workflow. It accepts individual files, directories, recursive targets, and multiple paths, making it suitable for editor integration and repository-wide checks.

This is free and open source software.

Key Features

  • Sorts standard, general, company, and project imports into groups.
  • Allows the order of import groups to be customised.
  • Can separate blank imports and dot imports into groups.
  • Supports company package prefixes.
  • Can remove unused imports.
  • Can set aliases for versioned or specially named packages.
  • Offers optional source formatting alongside import reorganisation.
  • Processes files, directories, recursive targets, and multiple paths.
  • Supports file and directory exclusions.
  • Can list files whose contents need changes.
  • Can separate explicitly named imports from their normal groups.
  • Supports file, write, and standard-output modes.
  • Provides an exit-status mode for automated checks.

Website: github.com/incu6us/goimports-reviser
Support:
Developer: Vyacheslav Pryimak
License: MIT License

goimports-reviser is written in Go. Learn Go with our recommended free books and free tutorials.

Related Software

Go Code Formatters
goimports-reviserSorts and groups imports by standard, third-party and project packages
gofumptEnforces stricter styling rules for cleaner, consistent source
gofmtApplies standardised indentation, spacing and source layout
golinesBreaks lengthy statements into readable, shorter lines
goimportsAutomatically adds missing imports and removes unused ones
gocondenseCombines multiline constructs to reduce unnecessary vertical space

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted