gojuno / minimock

Powerful mock generation tool for Go programming language
MIT License
577 stars 38 forks source link

Move tools to separate module #60

Closed evseevbl closed 2 years ago

evseevbl commented 2 years ago

This PR aims to fix bloating go.sum and vendor with dependencies from tools.go.

I have created a project with one simple interface and no imports. After generating mocks and running go mod tidy && go mod vendor I end up with way too many dependencies, most of which are not required for minimock to function. Moving tools to a separate module significantly reduces both number of dependencies and size of vendor

Latest master:

wc -l ./pr1/go.sum
    1525 ./pr1/go.sum
du -sh ./pr1/vendor
    55M ./pr1/vendor

After this PR:

wc -l ./pr2/go.sum
    121 ./pr2/go.sum
du -sh ./pr2/vendor
    240K ./pr2/vendor

Code used to reproduce:

package main

type Adder interface {
    Add(a, b int) int
}
evseevbl commented 2 years ago

@hexdigest could you please have a look at this PR?

hexdigest commented 2 years ago

@evseevbl

I released v3.0.10 version which now has a hundred times less dependencies. Thank you!