Documentation ¶
Overview ¶
Command goimports-wasabi updates your Go import lines, adding missing ones and removing unreferenced ones.
$ go install github.com/homuler/goimports-wasabi@latest
In addition to fixing imports, goimports-wasabi also formats your code in the same style as gofmt so it can be used as a replacement for your editor's gofmt-on-save hook.
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-wasabi") (add-hook 'before-save-hook 'gofmt-before-save)
For vim, set "gofmt_command" to "goimports-wasabi":
https://golang.org/change/39c724dd7f252 https://golang.org/wiki/IDEsAndTextEditorPlugins etc
For GoSublime, follow the steps described here:
http://michaelwhatcott.com/gosublime-goimports/
For other editors, you probably know what to do.
To exclude directories in your $GOPATH from being scanned for Go files, goimports respects a configuration file at $GOPATH/src/.goimportsignore which may contain blank lines, comment lines (beginning with '#'), or lines naming a directory relative to the configuration file to ignore when scanning. No globbing or regex patterns are allowed. Use the "-v" verbose flag to verify it's working and see what goimports-wasabi is doing.
File bugs or feature requests at:
https://github.com/homuler/goimports-wasabi/issues
Happy hacking!
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
event
Package event provides a set of packages that cover the main concepts of telemetry in an implementation agnostic way.
|
Package event provides a set of packages that cover the main concepts of telemetry in an implementation agnostic way. |
event/core
Package core provides support for event based telemetry.
|
Package core provides support for event based telemetry. |
event/export/eventtest
Package eventtest supports logging events to a test.
|
Package eventtest supports logging events to a test. |
event/export/metric
Package metric aggregates events into metrics that can be exported.
|
Package metric aggregates events into metrics that can be exported. |
event/export/ocagent
Package ocagent adds the ability to export all telemetry to an ocagent.
|
Package ocagent adds the ability to export all telemetry to an ocagent. |
event/tag
Package tag provides the labels used for telemetry throughout gopls.
|
Package tag provides the labels used for telemetry throughout gopls. |
fastwalk
Package fastwalk provides a faster version of filepath.Walk for file system scanning tools.
|
Package fastwalk provides a faster version of filepath.Walk for file system scanning tools. |
gocommand
Package gocommand is a helper for calling the go command.
|
Package gocommand is a helper for calling the go command. |
gopathwalk
Package gopathwalk is like filepath.Walk but specialized for finding Go packages, particularly in $GOPATH and $GOROOT.
|
Package gopathwalk is like filepath.Walk but specialized for finding Go packages, particularly in $GOPATH and $GOROOT. |
imports
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary.
|
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary. |
proxydir
Package proxydir provides functions for writing module data to a directory in proxy format, so that it can be used as a module proxy by setting GOPROXY="file://<dir>".
|
Package proxydir provides functions for writing module data to a directory in proxy format, so that it can be used as a module proxy by setting GOPROXY="file://<dir>". |
testenv
Package testenv contains helper functions for skipping tests based on which tools are present in the environment.
|
Package testenv contains helper functions for skipping tests based on which tools are present in the environment. |