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

Both branches of if-then-else are identical #5205

Closed
chavacava opened this issue Oct 25, 2024 · 1 comment · Fixed by #5211
Closed

Both branches of if-then-else are identical #5205

chavacava opened this issue Oct 25, 2024 · 1 comment · Fixed by #5211

Comments

@chavacava
Copy link

if roleId == orgRole.PublicId {
userIds = append(userIds, u.PublicId)
} else {
userIds = append(userIds, u.PublicId)
}

if roleId == projRole.PublicId {
groupIds = append(groupIds, g.PublicId)
} else {
groupIds = append(groupIds, g.PublicId)
}

Found with revive

bgajjala8 added a commit to bgajjala8/boundary that referenced this issue Oct 28, 2024
- Simplified code by removing unnecessary if-else conditions in the wantUserIds and wantGroupIds blocks.

Fixes hashicorp#5205
@bgajjala8
Copy link
Contributor

bgajjala8 commented Oct 28, 2024

Hi! I’ve submitted a fix to clean up the redundant code

#5211

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 a pull request may close this issue.

2 participants