Try to play golang tags How to test go test -tags=unit ./... go test -tags=integration ./... Send Flag on Build go build -ldflags="-X <var>" <file.go>