test: remove unreachable code in GetServerVersion (#48) - #49
Merged
talmacschen-arch merged 1 commit intoJul 16, 2026
Conversation
) GetServerVersion returned serverVersion early, leaving the trailing regexp-extraction block dead code, which go vet flagged as: testutils/functions.go:648:2: unreachable code The function has no callers, so drop the unreachable block to keep `go vet ./...` clean. No behavior change. Fixes cloudberry-contrib#48
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthrough
ChangesServer version output
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
leaocx
approved these changes
Jul 16, 2026
leaocx
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Clean removal of unreachable code.
- Confirmed the code after
return serverVersionis indeed dead GetServerVersionhas no callers in the reporegexpimport is still used byGetPslVersion, no import change needed- No behavior change
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.
What
Removes the unreachable code block at the end of
GetServerVersionintestutils/functions.go.Why
go vet ./...reports one warning onmain:GetServerVersionreturnsserverVersionearly, so the trailing regexp-extraction block (a comment block +regexp.MustCompile+return match) is dead code — never executed. The function has no callers in the repo, so there is no intended behavior to preserve; the safe, minimal fix is to drop the unreachable block.Verification
gofmt -l— cleango vet ./...— now clean (warning gone)go build ./...— passesmake unit— all 5 suites pass (dbconn 12/12, backup 469/470 + skips, TOC 45/45, testutils 8/8, utils 58/58)regexpis still imported and used by the siblingGetPslVersion, so no import change is needed. No behavior change.Fixes #48
Summary by CodeRabbit