Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twitchtv/checkexport
Refactoring tool to check Go code for public objects that could be private
https://github.com/twitchtv/checkexport
Last synced: about 2 months ago
JSON representation
Refactoring tool to check Go code for public objects that could be private
- Host: GitHub
- URL: https://github.com/twitchtv/checkexport
- Owner: twitchtv
- License: apache-2.0
- Created: 2017-09-01T14:16:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-01T14:36:52.000Z (about 7 years ago)
- Last Synced: 2024-07-05T08:36:02.612Z (3 months ago)
- Language: Go
- Homepage:
- Size: 169 KB
- Stars: 23
- Watchers: 12
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
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 ##
```bash
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`:```bash
$ 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:
```bash
# 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.