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

chore: prefer chan struct{} over chan bool for signalling #733

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

sonmezonur
Copy link
Member

@sonmezonur sonmezonur commented Jul 4, 2024

Prefer using chan struct{} since:

  • We are not interested in value being passed to channel, it is just used for signaling
  • It occupies zero memory (bool:64bit)
  • We used chan struct{} and chan bool interchangeably. To maintain a standard in the codebase, let's only use chan struct.

@sonmezonur sonmezonur requested a review from a team as a code owner July 4, 2024 12:03
@sonmezonur sonmezonur requested review from ilkinulas and seruman and removed request for a team July 4, 2024 12:03
@sonmezonur sonmezonur merged commit 8355901 into peak:master Jul 4, 2024
13 checks passed
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.

3 participants