Skip to content

wusendong/gogimport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gogimport

golang grouping import tool

introduction

gogimport will grouping imports by stdlib, thirdparty, local packages like the example below, unlike what goimports did, we prefer to do it this way:

  • do not remove unuse import, is useful when our codes is in development.
  • force grouping into three groups, this reduce the changed lines so tha make code review simple.
$ gogimport -local github.com/wusendong/example main.go
package main

import (
    "fmt"
    "log"

    "gopkg.in/redis.v5"
    "github.com/gorilla/context"

    "github.com/wusendong/example"
)

install

go get -u github.com/wusendong/gogimport

usage

Usage of gogimport:
gogimport [options] [file ...]

Options:
  -local string
        local package name
Example command:
gogimport -local ${packaname} some.go other.go

About

golang grouping import

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages