docs: Add doc comment to HGetAll describing behavior and complexity#3776
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
ofekshenawa
left a comment
There was a problem hiding this comment.
@0x48core thanks for filling this gap.
One small wording issue, the sentence about reply length being “twice the size of the hash” describes the raw Redis protocol reply, but in this API HGetAll returns a map[string]string, so callers observe one map entry per hash field.
Could we reword that line to avoid confusion?
maybe “HGetAll returns a map of all fields and values stored at key.”
Hey @ofekshenawa, thanks for your reply. I’ve updated it based on your suggestions. Thank you |
|
hey @ofekshenawa could you retrigger the failed action or please help me to check |
|
Hey @ofekshenawa, all actions passed, but I can’t merge this PR. Should I wait for another owner to approve, or is there another way? |
|
Hey @0x48core, All good, merged. |
Summary
HGetAllmethod describing its behavior, return value, time complexity, and linking to official Redis documentationMotivation
The

HGetAllfunction oncmdablewas missing a doc comment, so hovering over it in IDEs (e.g., VS Code, GoLand, Cursor) showed no documentation. This makes it harder for developers to understand the command's behavior without leaving their editor.Changes
Added a doc comment to HGetAll in hash_commands.go covering:
O(N)Test plan
go build ./...still passes with no errorsNote
Low Risk
Low risk documentation-only change; no runtime logic or APIs are modified.
Overview
Adds a GoDoc comment to
cmdable.HGetAlldescribing what it returns, behavior for missing keys (empty map), itsO(N)complexity, and a link to the official RedisHGETALLcommand documentation.Reviewed by Cursor Bugbot for commit 9908e86. Bugbot is set up for automated code reviews on this repo. Configure here.