Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default GORACE environment variable to race-detector enabled builds #103

Open
mark-rushakoff opened this issue Feb 27, 2023 · 0 comments

Comments

@mark-rushakoff
Copy link
Member

Per https://go.dev/doc/articles/race_detector, by default, a race-detector-enabled build will print data races to stderr and continue execution.

IMO, if someone is using the -race tagged builds, they are looking for fast feedback on the first data race encountered. Setting GORACE=halt_on_error=1 will cause the program to exit with code 66 on the first data race encountered, whereas the default value will continue execution to the end and probably exit 0.

I think the feedback would be clearer if defaulting to halt on error, and the user is always free to override it back to GORACE=halt_on_error=0 if they do want execution to continue past the first encountered data race.

@jonathanpberger jonathanpberger changed the title Add defaultGORACE environment variable to race-detector enabled builds Add default GORACE environment variable to race-detector enabled builds May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant