command
module
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Sep 16, 2019
License: MIT
Opens a new window with license information.
Imports: 16
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
goimport
is a tool to add, remove, or replace imports in Go files.
Install it with go get arp242.net/goimport
.
Example usage:
# Add errors package.
$ goimport -add errors foo.go
# Remove errors package.
$ goimport -rm errors foo.go
# Add errors package aliased as "errs"
$ goimport -add errors:errs foo.go
# Either add an import or replace existing errors with
# github.com/pkg/errors.
$ goimport -replace github.com/pkg/errors foo.go
# Try to "go get" package if it's not found.
$ goimport -get -add github.com/pkg/errors foo.go
# Print out only the import block as JSON (useful for editor integrations).
$ goimport -json -add github.com/pkg/errors foo.go
See goimport -h
for the full help.
Documentation
¶
goimport is a tool to add, remove, or replace imports in Go files.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.