Enable the race detector in the test environment
https://go.dev/doc/articles/race_detector
@timmyyuan Please fix the CI.
go test: -race requires cgo; enable cgo by setting CGO_ENABLED=1
@nodece Does pulsarctl must be built with CGO_ENABLED=0 ?
@nodece Does pulsarctl must be built with CGO_ENABLED=0 ?
No, we also can set the CGO_ENABLED=1, but we need to install the GCC in the docker image.
The pulsar image didn't include the gcc.
The CI has been passed, but we need to add check the gcc command in the docker image, if the gcc command not found, we need to install the gcc.
@nodece go test -race is only called in the test environment, do we have to check gcc since the CI passed (which means a C/C++ compiler is obviously available) ? Do you mean we'd better keep the same CGO_ENABLED value in the test and production environments ?
go test -race is only called in the test environment, do we have to check gcc since the CI passed (which means a C/C++ compiler is obviously available)
Yes, you are right.
Do you mean we'd better keep the same CGO_ENABLED value in the test and production environments?
I think everything is OK.
@timmyyuan Currently, we are using the Pulsar [email protected], so this CI has been passed, but the Pulsar [email protected] don't include the gcc, so we need to install the gcc command.