Skip to content

GO-7185 fix calcMedian panic on empty input#220

Merged
cheggaaa merged 1 commit into
mainfrom
GO-7185-calcmedian-empty-slice-panic
Apr 22, 2026
Merged

GO-7185 fix calcMedian panic on empty input#220
cheggaaa merged 1 commit into
mainfrom
GO-7185-calcmedian-empty-slice-panic

Conversation

@cheggaaa
Copy link
Copy Markdown
Member

Guard against out-of-bounds indexing when the sorted slice is empty so GetSpaceStats stays safe under non-default debug endpoint usage.


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Guard against out-of-bounds indexing when the sorted slice is empty so
GetSpaceStats stays safe under non-default debug endpoint usage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

New Coverage 50.9% of statements
Patch Coverage 100.0% of changed statements (2/2)

Coverage provided by https://github.com/seriousben/go-patch-cover-action

@cheggaaa cheggaaa merged commit 033b308 into main Apr 22, 2026
6 checks passed
@cheggaaa cheggaaa deleted the GO-7185-calcmedian-empty-slice-panic branch April 22, 2026 14:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants