Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/ddc/base/runtime_conventions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import (
"github.com/fluid-cloudnative/fluid/pkg/common"
)

// 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.
Comment on lines +7 to +15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
// 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
  1. 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)

func (info *RuntimeInfo) GetWorkerStatefulsetName() string {
switch info.runtimeType {
// JindoRuntime has a extra "-jindofs" suffix in worker statefulset name.
Expand Down
Loading