Slimdep — prune vendored Go code with blind tree shaking — α release
Installation
go get -u -v github.com/frankbraun/slimdep
Mode of operation
slimdep
assumes that all dependencies are vendored into the vendor
folder.
- Use
go/parser
to parse into AST and thenast.Walk
to process it, analog to gofmt. - Remove all functions except for
init
(maybe even remove types, variables, consts). - Compile.
- Loop: analyse error message -> introduce missing function -> compile again.
- To support other platforms: cross compile (option
-a
).