checkexport

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

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

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

README

checkexport

checkexport is a tool to make sure that all the stuff you export is actually used somewhere else.

You run it against a particular package, and within a scope. By default, the repo root of the targeted package is used.

Install

go get github.com/twitchtv/checkexport

Examples

Check whether exported values in github.com/golang/dep/internal/gps are used anywhere else in github.com/golang/dep:

$ checkexport -scope=github.com/golang/dep/... github.com/golang/dep/internal/gps
/Users/snelson/go/src/github.com/golang/dep/internal/gps/lock.go:31:6: func LocksAreEq is exported but not used anywhere else in github.com/golang/dep/...
/Users/snelson/go/src/github.com/golang/dep/internal/gps/lock.go:78:6: type SimpleLock is exported but not used anywhere else in github.com/golang/dep/...
/Users/snelson/go/src/github.com/golang/dep/internal/gps/lock.go:153:25: method LockedProject.Eq is exported but not used anywhere else in github.com/golang/dep/...
/Users/snelson/go/src/github.com/golang/dep/internal/gps/manifest.go:46:2: method RootManifest.IgnoredPackages is exported but not used anywhere else in github.com/golang/dep/...

Check across repositories, even across everything in your $GOPATH:

# This can take a very long time if you have a lot of packages - a more targeted
# search is better!
$ checkexport -scope="..." github.com/spenczar/tdigest

If -scope is unset, it will try to deduce the root of a package's repo and use that.

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