This repository has been archived by the owner. It is now read-only.
Unexport notused exported identifiers in Go
Switch branches/tags
Nothing to show
Clone or download
Latest commit b098a8e Aug 25, 2015
Failed to load latest commit information.
LICENSE BSD 3-clause license Aug 22, 2015 update Aug 24, 2015
unexport.go unexport: fix flag parsing Aug 24, 2015


Unexport is a tool which unexports nonused exported identifiers. It was created as a part of Go challenge #5. Checkout the examples below


go get

Usage and Examples

Unexport exported identifiers in the encoding/pem package:

$ unexport -package encoding/pem

Process the package and display any possible changes. It doesn't unexport exported identifiers because of the -dryrun flag

$ unexport -package -dryrun

Unexport only the "Color" and "Attribute" identifiers from the package. Note that if the identifiers are used by other packages, it'll silently fail

$ unexport -package -identifier "Color,Attribute"


The BSD 3-Clause License - see LICENSE for more details