chore: replace redundant boolean closure in makeAppStageStatus with id > 0#6993
Open
deepak0x wants to merge 1 commit into
Open
chore: replace redundant boolean closure in makeAppStageStatus with id > 0#6993deepak0x wants to merge 1 commit into
deepak0x wants to merge 1 commit into
Conversation
deepak0x
requested review from
prakarsh-dt,
vikramdevtron and
vivek-devtron
as code owners
July 20, 2026 09:19
|
Bito Review Skipped - Source Branch Not Found |
…d > 0 makeAppStageStatus built the Status field with an inline anonymous function returning true/false from an if id > 0 block. Status is a bool, so the closure is equivalent to the expression id > 0. Replace it with Status: id > 0. Signed-off-by: Deepak Bhagat <deepak988088@gmail.com>
deepak0x
force-pushed
the
fix/appstagestatus-redundant-boolean
branch
from
July 20, 2026 09:29
d33a5d3 to
47e8584
Compare
|
Author
|
@prakarsh-dt @nishant-d @vikramdevtron @vivek-devtron this is a small self-contained cleanup in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
makeAppStageStatusinpkg/app/appDetails/read/AppDetailsReadService.gobuilt theStatusfield with an inline anonymous function that returnedtrue/falsefrom anif id > 0block.AppStageStatus.Statusis abool, so the closure is equivalent to the expressionid > 0. This replaces it withStatus: id > 0. Behavior is unchanged.Fixes #6992
How Has This Been Tested?
Verified locally with a table test for
makeAppStageStatuscoveringid= 5, 1, 0 and -1, asserting the resultingStatusalong with theStage,StageNameandRequiredfields. It passes against both the original closure and the simplified expression, confirming the two are equivalent.gofmtandgo vetare clean. The test is kept out of the change to match how the same redundant-branch cleanups were merged in this repo (for example #6668 and #6670 were source-only).Checklist:
Does this PR introduce a user-facing change?