Import Group Ordering

There should be two import groups:

  • Standard library
  • Everything else This is the grouping applied by goimports by default.
BadGood
  1. import (
  2. "fmt"
  3. "os"
  4. "go.uber.org/atomic"
  5. "golang.org/x/sync/errgroup"
  6. )
  1. import (
  2. "fmt"
  3. "os"
  4.  
  5. "go.uber.org/atomic"
  6. "golang.org/x/sync/errgroup"
  7. )