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

Refactor some code in process.go #2251

Merged
merged 3 commits into from
Jul 31, 2023
Merged

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Jul 27, 2023

More details available commit by commit

This is intended to be a no-op refactor. `errors.As` should work in more circumstances than the previous type assertion. Other than that, the order of the edge and main cases have been inverted, and the error message has been tweaked a little.
This means the goroutine is spun up when the context is nil when previously
it would not be. This is fine because they are pretty cheap, and also it
it is highly unlikely that the context will be nil at runtime.
@triarius triarius force-pushed the pdp-1405-refactor-process-code branch from 8c3fda4 to d471235 Compare July 27, 2023 22:41
@triarius triarius requested a review from a team July 27, 2023 22:42
@@ -43,6 +43,10 @@ var signalMap = map[string]Signal{
"SIGTERM": SIGTERM,
}

var ErrNotWaitStatus = errors.New(
"unimplemented for systems where exec.ExitError.Sys() is not syscall.WaitStatus",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is not helpful to users, so should not really be exposed except under debug. However, it is more or less what was there before.

@triarius triarius requested review from a team and removed request for a team July 31, 2023 00:05
Copy link
Contributor

@moskyb moskyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 love your work

@triarius triarius merged commit 6ee27f3 into main Jul 31, 2023
1 check passed
@triarius triarius deleted the pdp-1405-refactor-process-code branch July 31, 2023 03:45
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@DrJosh9000 DrJosh9000 added the cleanup Cleaning up code, refactoring, etc label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Cleaning up code, refactoring, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants