8000 GitHub - golang-libs/goimportx
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

golang-libs/goimportx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goimportx

Go License: MIT

goimportx is a tool to help you manage your go imports.

Features

  • Automatically sort and group your go imports.
  • Support custom group rules.
  • Support write result to file.
  • Only support go module.
  • Use golang official sort algorithm.
  • Automatically remove parentheses when there is only one import.
  • Automatically remove duplicate empty new-line.

Installation

$ go install github.com/golang-libs/goimportx@latest

Usage

$ goimportx --file /path/to/file.go

Help

goimportx --help
sort and group go imports

Usage:
  goimportx [flags]

Examples:
goimportx --file /path/to/file.go --group "system,local,third"

Flags:
  -f, --file string    file path
  -g, --group string   group rule, split by comma, only supports [system,local,third,others] (default "system,local,third")
  -h, --help           help for goimportx
  -v, --version        version for goimportx
  -w, --write          write result to (source) file instead of stdout

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0