gitwtfhub

wtf is gogroup?

jonasfranz/gogroup — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2017-06-30

GoAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

A tool that checks and automatically fixes the order and grouping of import statements in Go source files, keeping projects consistent.

Mindmap

mindmap
  root((gogroup))
    What it does
      Checks import order
      Auto-fixes with rewrite flag
      Enforces grouping rules
    Tech stack
      Go
      CLI
    Use cases
      Keep imports tidy
      Enforce team standards
      Run in pre-commit hooks
    Audience
      Go developers
      Backend teams
    Current state
      Early stage
      Common cases supported
      Some edge cases pending

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Check that a Go project's import statements follow a defined order (stdlib, internal, third-party)

REASON 2

Automatically rewrite out-of-order imports with the -rewrite flag

REASON 3

Run as part of a build process or pre-commit hook to keep a team's codebase consistent

REASON 4

Reduce noisy diffs and code review debate over import ordering

What's in the stack?

Go

How it stacks up

jonasfranz/gogroup42wim/fabio42wim/go-xmpp
LanguageGoGoGo
Last pushed2017-06-302018-02-042020-01-24
MaintenanceDormantDormantDormant
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Early-stage project, some edge cases like multiple import blocks or C imports aren't fully handled yet.

Yoink these prompts

Prompt 1
Show me how to configure gogroup to enforce stdlib-first, then internal, then third-party import order.
Prompt 2
Help me add gogroup as a pre-commit hook so imports are checked before every commit.
Prompt 3
Explain what the -rewrite flag does and how it differs from just checking for violations.
Prompt 4
Walk me through running gogroup across all Go files in my project's CI pipeline.

Frequently asked questions

wtf is gogroup?

A tool that checks and automatically fixes the order and grouping of import statements in Go source files, keeping projects consistent.

What language is gogroup written in?

Mainly Go. The stack also includes Go.

Is gogroup actively maintained?

Dormant — no commits in 2+ years (last push 2017-06-30).

How hard is gogroup to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gogroup for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.