Skip to content

[nightshift] code-quality: remove dead code, fix unreachable paths, use built-in min()#1

Open
Microck wants to merge 1 commit intomainfrom
nightshift/code-quality
Open

[nightshift] code-quality: remove dead code, fix unreachable paths, use built-in min()#1
Microck wants to merge 1 commit intomainfrom
nightshift/code-quality

Conversation

@Microck
Copy link
Copy Markdown
Owner

@Microck Microck commented Apr 1, 2026

Automated by Nightshift v3 (GLM 5.1).

Task: code-quality
Category: pr
Changes:

  • Remove unused requestJSON/responseJSON variables in dashboard.go (computed but immediately discarded)
  • Replace custom minInt() with Go built-in min() (go.mod specifies Go 1.25.6)
  • Fix displayRole() to check empty string before slicing, preventing potential panic
  • Remove unreachable 500 error path in makeToolHandler (upstreamCalled was always true at the check point)
  • Remove dead upstreamCalled variable

Verification: go build, go vet, go test ./... all pass.

…se built-in min()

- Remove unused requestJSON/responseJSON variables in dashboard.go
- Replace custom minInt() with built-in min() (Go 1.21+, using 1.25.6)
- Fix displayRole() to prevent panic on empty string
- Remove unreachable 500 error path in makeToolHandler (upstreamCalled always true)
- Remove dead upstreamCalled variable
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.

2 participants