Reputation: 1081
I have a pretty big golang project that produces several executables, when I update my code I want an easy and fast way to rebuild all of them however it takes ~20-25 sec to build all of them and most of the time I change just 1 or 2
The ultimate goal - detect what changed and rebuild only changed targets as fast as possible(CI)
p.s. some parts of project use cgo, and this takes the 40-50% of the build time
Upvotes: 4
Views: 1398
Reputation: 54107
From the top level of your project
go install ./...
Should install all the binaries into $GOPATH/bin
go install
caches the build artifacts (unlike go build
) so should do incremental builds exactly as you want.
Upvotes: 6