.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / cmd / goimports / doc.go
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 /*
6
7 Command goimports updates your Go import lines,
8 adding missing ones and removing unreferenced ones.
9
10      $ go get golang.org/x/tools/cmd/goimports
11
12 In addition to fixing imports, goimports also formats
13 your code in the same style as gofmt so it can be used
14 as a replacement for your editor's gofmt-on-save hook.
15
16 For emacs, make sure you have the latest go-mode.el:
17    https://github.com/dominikh/go-mode.el
18 Then in your .emacs file:
19    (setq gofmt-command "goimports")
20    (add-hook 'before-save-hook 'gofmt-before-save)
21
22 For vim, set "gofmt_command" to "goimports":
23     https://golang.org/change/39c724dd7f252
24     https://golang.org/wiki/IDEsAndTextEditorPlugins
25     etc
26
27 For GoSublime, follow the steps described here:
28     http://michaelwhatcott.com/gosublime-goimports/
29
30 For other editors, you probably know what to do.
31
32 To exclude directories in your $GOPATH from being scanned for Go
33 files, goimports respects a configuration file at
34 $GOPATH/src/.goimportsignore which may contain blank lines, comment
35 lines (beginning with '#'), or lines naming a directory relative to
36 the configuration file to ignore when scanning. No globbing or regex
37 patterns are allowed. Use the "-v" verbose flag to verify it's
38 working and see what goimports is doing.
39
40 File bugs or feature requests at:
41
42     https://golang.org/issues/new?title=x/tools/cmd/goimports:+
43
44 Happy hacking!
45
46 */
47 package main // import "golang.org/x/tools/cmd/goimports"