go-import-manager

command module
v0.0.0-...-c7ac3fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

Go Import Manager

Go Import Manager is a small cli tool which allows you to manipulate the import statements of a go file. Rather than relying on regex text replacements, it will parse and manipulate the AST of a file to do its job. This is useful if you want to automate the build of an application that uses a caddy like plugin system.

The latest binaries can be downloaded from the Github release pages.

Usage

The application uses a docker style cli, with subcommands

List

Options

  • output, o: The file to which the output will be written (default: stdout)

Example

go-import-manager list main.go
Add

Options

  • output, o: The file to which the output will be written (default: stdout)
  • inplace, i: Set to edit the file in place

Example

go-import-manager add main.go "fmt"
Delete

Options

  • output, o: The file to which the output will be written (default: stdout)
  • inplace, i: Set to edit the file in place

Example

go-import-manager delete main.go "fmt"
Replace

Options

  • output, o: The file to which the output will be written (default: stdout)
  • inplace, i: Set to edit the file in place

Example

go-import-mananager replace main.go "fmt" "github.com/foo/my-fmt"

Build

go get "github.com/wdullaer/go-import-manager"

TODO

  • Add tests
  • Add automated builds for more platforms

License

Apache-2.0 © Wouter Dullaert

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL