chore(lint): resolve gocritic findings#720
Conversation
Address all 39 gocritic findings: - ifElseChain: rewrite if-else chains to switch statements - assignOp: use += compound assignment - appendAssign: assign append result to same slice; use slices.Concat where two distinct slice fields were combined (avoids aliasing) - deprecatedComment: use canonical 'Deprecated:' casing - exitAfterDefer: call stop() explicitly before os.Exit - singleCaseSwitch: rewrite single-case type switch to type assertion
✅ Deploy Preview for devsydev canceled.
|
|
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 (21)
📝 WalkthroughWalkthroughThe pull request refactors conditional branches to ChangesControl-flow and collection refactors
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for images-devsy-sh canceled.
|
Resolves all 39
gocriticlinter findings reported by golangci-lint.Changes by check
if / else ifchains toswitchstatementsx = x + y→x += y(e2e/framework/framework.go)pkg/agent/tunnelserver/tunnelserver.go:opts := append(options, …)now assigns back tooptionsappend(UserCredentials.GitHttp, ProjectCredentials.GitHttp…)→slices.Concat(…)to avoid mutating the sharedUserCredentialsbacking arrayDEPRECATED:→ canonicalDeprecated:casingcmd/internal/agentcontainer/daemon.go:defer stop()never ran beforeos.Exit; now callsstop()explicitly before exitingpkg/types/types.go)Verification
gocritic: 39 → 0staticcheckand 1modernizefinding that flagged the same chainsgo build ./...passes; affected-package tests pass (389)golangci-lint fmtreports no diffSummary by CodeRabbit
Bug Fixes
Refactor
Documentation