/slimdep

Slimdep — prune vendored Go code with blind tree shaking

Primary LanguageGoThe UnlicenseUnlicense

Slimdep — prune vendored Go code with blind tree shaking — α release

GoDoc Build Status Go Report Card

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 then ast.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).