docs: fix typos in GoDoc comments for quantity and error utility func… - #6127
docs: fix typos in GoDoc comments for quantity and error utility func…#6127saiashok0981 wants to merge 1 commit into
Conversation
…tions Fix two misspelled function names in GoDoc comments within pkg/utils/quantity.go: - Line 40: 'TransfromQuantityToJindoUnit' -> 'TransformQuantityToJindoUnit' - Line 72: 'TranformQuantityToUnits' -> 'TransformQuantityToUnits' Fix typo in pkg/utils/errors.go IgnoreAlreadyExists comment: - 'already existes error' -> 'already exists error' Add missing GoDoc comment for the exported function IgnoreNoKindMatchError in pkg/utils/errors.go. Exported functions should always have a documentation comment per Go conventions (https://go.dev/blog/godoc), and the absence of one suppresses godoc output and linting warnings. These are documentation-only changes with zero runtime behavior impact. Signed-off-by: saiashok103@gmail.com
|
Hi @saiashok0981. Thanks for your PR. I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
There was a problem hiding this comment.
Code Review
This pull request corrects typos in function comments within pkg/utils/errors.go and pkg/utils/quantity.go, and adds descriptive documentation for the IgnoreNoKindMatchError function. The reviewer provided actionable suggestions to further improve the clarity and grammatical consistency of the documentation comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ) | ||
|
|
||
| // IgnoreAlreadyExists ignores already existes error | ||
| // IgnoreAlreadyExists ignores already exists error |
There was a problem hiding this comment.
To improve clarity and grammatical correctness, this comment could be rephrased. The current phrasing 'ignores already exists error' is slightly awkward.
| // IgnoreAlreadyExists ignores already exists error | |
| // IgnoreAlreadyExists ignores errors indicating that a resource already exists. |
| } | ||
|
|
||
| // TransfromQuantityToJindoUnit transform a given input quantity to another one | ||
| // TransformQuantityToJindoUnit transform a given input quantity to another one |
There was a problem hiding this comment.
To fully align with GoDoc conventions, the verb in the summary sentence should be in the third-person singular form. The verb transform should be transforms.
| // TransformQuantityToJindoUnit transform a given input quantity to another one | |
| // TransformQuantityToJindoUnit transforms a given input quantity to another one |
|
@saiashok0981 — this PR is blocked from merging by a failing DCO check. Please resolve this now. For a single-commit PR: For multiple commits on this branch: The code review side is finished and any merge labels already on the PR will take effect once DCO turns green. Reference: https://github.com/apps/dco |
|
/copilot review |
| } | ||
|
|
||
| // TransfromQuantityToJindoUnit transform a given input quantity to another one | ||
| // TransformQuantityToJindoUnit transform a given input quantity to another one |
There was a problem hiding this comment.
Since you're already touching this line for the typo, worth making the GoDoc summary read as third-person singular: "transforms a given input quantity..." rather than "transform". Its sibling TransformQuantityToAlluxioUnit has the same quirk, so no need to chase that one here unless you feel like it.
| ) | ||
|
|
||
| // IgnoreAlreadyExists ignores already existes error | ||
| // IgnoreAlreadyExists ignores already exists error |
There was a problem hiding this comment.
Optional: "ignores already exists error" still reads a little terse. Something like "ignores errors indicating that a resource already exists" flows better, but the current fix is already correct — fine to leave as-is.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6127 +/- ##
=======================================
Coverage 65.08% 65.08%
=======================================
Files 485 485
Lines 33989 33989
=======================================
Hits 22122 22122
Misses 10126 10126
Partials 1741 1741 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves GoDoc quality in pkg/utils by correcting typos in exported function doc comments and adding missing documentation for an exported error-handling helper, ensuring generated docs and tooling (e.g., gopls) show accurate information.
Changes:
- Fix a misspelled exported identifier name in a GoDoc comment in
quantity.go. - Fix a typo in the
IgnoreAlreadyExistsGoDoc comment inerrors.go. - Add a GoDoc comment for the exported
IgnoreNoKindMatchErrorhelper inerrors.go.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/utils/quantity.go | Corrects a misspelled function name in a GoDoc comment so docs match the exported identifier. |
| pkg/utils/errors.go | Fixes/introduces GoDoc for exported error helpers, including adding missing documentation for IgnoreNoKindMatchError. |
Suppressed comments (1)
pkg/utils/errors.go:44
- This GoDoc comment says the function ignores NoKindMatch errors, but the implementation calls apimeta.IsNoMatchError, which returns true for both NoResourceMatchError and NoKindMatchError (see vendor/k8s.io/apimachinery/pkg/api/meta/errors.go:127-132). The comment should describe the broader behavior to avoid misleading API docs.
// IgnoreNoKindMatchError ignores NoKindMatch errors returned when the API server
// does not recognize the requested resource kind. This is useful when checking
// for optional CRD-backed resources that may not be installed in all clusters.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ) | ||
|
|
||
| // IgnoreAlreadyExists ignores already existes error | ||
| // IgnoreAlreadyExists ignores already exists error |
cheyang
left a comment
There was a problem hiding this comment.
@saiashok0981 — this PR is blocked from merging by a failing DCO check.
The DCO bot requires every commit to carry a Signed-off-by: trailer; without it the PR cannot land regardless of lgtm / approved labels or otherwise-green CI.
Please resolve this now. For a single-commit PR:
git commit --amend -s
git push --force-with-lease
For multiple commits on this branch:
git rebase --signoff origin/master
git push --force-with-lease
The code review side is finished and any merge labels already on the PR will take effect once DCO turns green. Reference: https://github.com/apps/dco
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |



Fix three GoDoc documentation errors across pkg/utils/quantity.go and pkg/utils/errors.go: two misspelled function names in doc comments and one typo in an existing comment. Additionally, add the missing GoDoc comment for the exported function IgnoreNoKindMatchError.
Motivation
Go's documentation convention (godoc) requires that every exported identifier is documented, and that the doc comment begins with the name of the identifier. When GoDoc comment function names are misspelled, automated API documentation generators and IDE tooling (e.g., gopls hover) produce misleading output. The IgnoreNoKindMatchError function was previously exported with no comment at all, which suppresses its entry in generated docs and triggers golint / revive lint warnings.
Fixing these now reduces technical documentation debt and ensures consistency across the pkg/utils package, which is among the most widely used internal packages in this repository.
Signed-off-by: saiashok103@gmail.com