bradfitz/goimports

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

Go

1,039

63 commits

updated Mar 31, 2021

See the code

README

This tool updates your Go import lines, adding missing ones and
removing unreferenced ones.

     $ go get golang.org/x/tools/cmd/goimports

     Note the new location. This project has moved to the official
     go.tools repo. Pull requests here will no longer be accepted.
     Please use the Go process: http://golang.org/doc/contribute.html

It acts the same as gofmt (same flags, etc) but in addition to code
formatting, also fixes imports.

See usage and editor integration notes, now moved elsewhere:

   http://godoc.org/golang.org/x/tools/cmd/goimports

Happy hacking!

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

bradfitz/goimports

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

Go

1,039

63 commits

updated Mar 31, 2021

See the code

README

This tool updates your Go import lines, adding missing ones and
removing unreferenced ones.

     $ go get golang.org/x/tools/cmd/goimports

     Note the new location. This project has moved to the official
     go.tools repo. Pull requests here will no longer be accepted.
     Please use the Go process: http://golang.org/doc/contribute.html

It acts the same as gofmt (same flags, etc) but in addition to code
formatting, also fixes imports.

See usage and editor integration notes, now moved elsewhere:

   http://godoc.org/golang.org/x/tools/cmd/goimports

Happy hacking!

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Significant stargazers

Jason Hall

621 followers · starred Nov 2013

Kamil Kisiel

487 followers · starred Jun 2013

Alexander Medvednikov

2,743 followers · starred Aug 2015

Jinzhu

5,589 followers · starred Sep 2013