We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
One of the rewrites in https://github.com/getgrit/stdlib/blob/main/.grit/patterns/go/useless_if_else_body.md is wrong.
It rewrites
if ($conditon) { $body } else { $body }
to
if ($conditon) { $body }
Oops. (Also, condition is misspelled, and Go doesn't support using integers as booleans in conditions. But those are less important.)
The other rewrites is only sometimes sound. Rewriting
if ($conditon) { $body } else if ($conditon) { $body }
is unsafe if evaluating the condition has side-effects.
Given GritQL's goals, that might be ok. But it might be worth a sentence in the docs there?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
One of the rewrites in https://github.com/getgrit/stdlib/blob/main/.grit/patterns/go/useless_if_else_body.md is wrong.
It rewrites
to
Oops. (Also, condition is misspelled, and Go doesn't support using integers as booleans in conditions. But those are less important.)
The other rewrites is only sometimes sound. Rewriting
to
is unsafe if evaluating the condition has side-effects.
Given GritQL's goals, that might be ok. But it might be worth a sentence in the docs there?
The text was updated successfully, but these errors were encountered: