go-import-extractor

command module
v0.0.0-...-04d55c7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2014 License: MIT Imports: 5 Imported by: 0

README

go-import-extractor

go-import-extractor helps to analyze go programs. It extracts a list of imported packages from either a .go file or a go package. On a go package, it may recursively analyze the imported packages.

Install

go get github.com/freenerd/go-import-extractor

Use

For basic usage give the absolute go source file path as first argument. In this example, we analyze the code of this package:

go-import-extractor $GOPATH/src/github.com/freenerd/go-import-extractor/main.go

The output goes to STDOUT and is formated as xml. It looks like this:

<imports>
  <import>fmt</import>
  <import>github.com/freenerd/go-import-extractor/extractor</import>
</imports>

To analyze a whole package, call like this:

go-import-extractor -p github.com/freenerd/go-import-extractor

Output can be filtered by specific suspect package calls (TODO: make customizable)

go-import-extractor -p github.com/freenerd/go-import-extractor -s

Output formats

XML only at the moment

Limitations

  • does not expose package renames, but only uses the original package import name

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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