Skip to content

jmptrader/goimports

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This tool updates your Go imports, adding missing ones and removing
unreferenced onces.

It's a fork of gofmt, and will also fmt your code, so it can be used
as a replacement for your gofmt-on-save hook in your editor.

Caveats:

For adding, it currently only knows about the standard library. There
is not yet support for searching/indexing GOPATH or calling out to a
helper program to look up from "foo.Bar" to the necessary import.

For removal, it assumes the import path base matches the package name,
which is best practice anyway, like:

    import "github.com/you/foo" // assumes to import package "foo"

If they don't match, explictly name the package name in your import
line:

    import foo "github.com/you/not-quite-foo"

These caveats might be fixed.

About

Tool to fix (add, remove) your Go imports automatically.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%