1
0
mirror of https://github.com/golang/go synced 2024-11-19 01:34:40 -07:00
go/cmd/goimports/doc.go
Brad Fitzpatrick 05bc285da4 cmd/goimports: update doc, remove old gofmt flags
Don't say the word "fork" (not accurate), and remove the
tab/comment flags that were removed from gofmt.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/61410052
2014-02-12 08:35:02 -08:00

34 lines
998 B
Go

/*
Command goimports updates your Go import lines,
adding missing ones and removing unreferenced ones.
$ go get code.google.com/p/go.tools/cmd/goimports
It's a drop-in replacement for your editor's gofmt-on-save hook.
It has the the same command-line interface as gofmt and formats
your code in the same way.
For emacs, make sure you have the latest (Go 1.2+) go-mode.el:
https://go.googlecode.com/hg/misc/emacs/go-mode.el
Then in your .emacs file:
(setq gofmt-command "goimports")
(add-to-list 'load-path "/home/you/goroot/misc/emacs/")
(require 'go-mode-load)
(add-hook 'before-save-hook 'gofmt-before-save)
For vim, set "gofmt_command" to "goimports":
https://code.google.com/p/go/source/detail?r=39c724dd7f252
https://code.google.com/p/go/source/browse#hg%2Fmisc%2Fvim
etc
For GoSublime, follow the steps described here:
http://michaelwhatcott.com/gosublime-goimports/
For other editors, you probably know what to do.
Happy hacking!
*/
package main