This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.#5884
This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.#5884F-Hilbert wants to merge 1 commit into
Conversation
|
[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 |
|
Hi @F-Hilbert. 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 adds documentation to the GetWorkerStatefulsetName function in pkg/ddc/base/runtime_conventions.go. The reviewer noted that the documentation style used is unidiomatic for Go, specifically the inclusion of explicit 'Parameters' and 'Returns' sections, and provided a suggestion to simplify the comment to align with Go best practices.
| // GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime. | ||
| // This function determines the name of the worker StatefulSet based on the runtime type. | ||
| // Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix. | ||
| // | ||
| // Parameters: | ||
| // - None: This function does not take any parameters. | ||
| // | ||
| // Returns: | ||
| // - string: The generated worker StatefulSet name for the current runtime. |
There was a problem hiding this comment.
The documentation style using explicit Parameters and Returns sections is unidiomatic in Go. According to Go best practices (e.g., Effective Go), doc comments should be concise paragraphs where the first sentence starts with the name of the function. Redundant sections like Parameters: None should be avoided to maintain idiomatic code quality and reduce noise.
| // GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime. | |
| // This function determines the name of the worker StatefulSet based on the runtime type. | |
| // Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix. | |
| // | |
| // Parameters: | |
| // - None: This function does not take any parameters. | |
| // | |
| // Returns: | |
| // - string: The generated worker StatefulSet name for the current runtime. | |
| // GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime. | |
| // Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix. |
References
- Go doc comments should be simple sentences or paragraphs starting with the name of the declared identifier. Sections like 'Parameters' and 'Returns' are discouraged. (link)
…entions.go. Signed-off-by: Hilbert <3505543807@qq.com>
|
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5884 +/- ##
=======================================
Coverage 61.65% 61.65%
=======================================
Files 480 480
Lines 32613 32613
=======================================
Hits 20108 20108
Misses 10897 10897
Partials 1608 1608 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



…entions.go.
Ⅰ. Describe what this PR does
This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.
Ⅱ. Does this pull request fix one issue?
fixes #5883
Ⅲ. Special notes for reviews
None.