In my previous post, I covered the basics of Go Race detector. In most Golang, projects, we would have multiple projects.
For some reason, if we want to skip race detector for some packages, we can use this option as the first line of the package & an empty second line:
// +build !race
Babus-MacBook-Pro:Race_Tests_inGolang babuneelam$ go build -racepackage racetest: build constraints exclude all Go files in /Users/babuneelam/Projects/GoProjects/Race_Tests_inGolangBabus-MacBook-Pro:Race_Tests_inGolang babuneelam$
I have only a single package in this, so this error. If I were to have multiple packages in this repository, it would have build those.
1 comment:
This is so helpful!! Thanks for this article
Post a Comment