1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00
go/cmd/goimports/doc.go
Andrew Gerrand 5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00

34 lines
962 B
Go

/*
Command goimports updates your Go import lines,
adding missing ones and removing unreferenced ones.
$ go get golang.org/x/tools/cmd/goimports
It's a drop-in replacement for your editor's gofmt-on-save hook.
It has the same command-line interface as gofmt and formats
your code in the same way.
For emacs, make sure you have the latest go-mode.el:
https://github.com/dominikh/go-mode.el
Then in your .emacs file:
(setq gofmt-command "goimports")
(add-to-list 'load-path "/home/you/somewhere/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