Skip to content

Refactor cancellation logic into a separate section#1191

Closed
philip-peterson wants to merge 2 commits intoa-h:mainfrom
philip-peterson:cleanup-cancellation
Closed

Refactor cancellation logic into a separate section#1191
philip-peterson wants to merge 2 commits intoa-h:mainfrom
philip-peterson:cleanup-cancellation

Conversation

@philip-peterson
Copy link
Copy Markdown
Contributor

  • Since the logic is semantically a separate section, moves cancellation into a new function.
  • Because variables can be moved closer to their usages, moves a couple variable declarations down.

errs <- FatalError{Err: fmt.Errorf("failed to walk files: %w", err)}
return
}
close(fileEvents) // TODO should this be defer'red?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should this close be in a defer, since an error could cause an early return and never close the channel?

@a-h
Copy link
Copy Markdown
Owner

a-h commented Jul 24, 2025

I've done a major refactor in #1227 to hopefully make the intent of all that code a lot clearer.

@a-h a-h closed this Jul 24, 2025
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

Successfully merging this pull request may close these issues.

2 participants