-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
interp: panic on division by zero #892
Labels
Comments
Thanks, this does look like a bug. Happy to accept a patch with a test. |
mvdan
added a commit
that referenced
this issue
Oct 20, 2022
Arithm now returns one more type of error for this case. Update the interpreter accordingly, and add tests. The behavior we adopt follows what Bash does when not run interactively, so start documenting that in the package godoc. Also add a TODO as we should have some standard to tell whether errors coming from the expand package or the user's handlers are fatal. That is, whether they should exit the shell, and with what status code. Fixes #892.
mvdan
added a commit
that referenced
this issue
Oct 21, 2022
Arithm now returns one more type of error for this case. Update the interpreter accordingly, and add tests. The behavior we adopt follows what Bash does when not run interactively, so start documenting that in the package godoc. Also add a TODO as we should have some standard to tell whether errors coming from the expand package or the user's handlers are fatal. That is, whether they should exit the shell, and with what status code. While here, replace black and white with block and allow, which are more self-explanatory. Fixes #892.
mvdan
added a commit
that referenced
this issue
Oct 21, 2022
Arithm now returns one more type of error for this case. Update the interpreter accordingly, and add tests. The behavior we adopt follows what Bash does when not run interactively, so start documenting that in the package godoc. Also add a TODO as we should have some standard to tell whether errors coming from the expand package or the user's handlers are fatal. That is, whether they should exit the shell, and with what status code. While here, replace black and white with block and allow, which are more self-explanatory. Fixes #892.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the invalid command
bash rightfully complains:
but gosh panics:
This happens in v3.0.0 and master. I didn't try any tags older than v3.0.0. Tested with go 1.18.1.
The text was updated successfully, but these errors were encountered: