New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Code format (including comment) #565
Conversation
pkg/fluentd/router/pluginstore.go
Outdated
@@ -30,7 +30,7 @@ type LabelRouter struct { | |||
Routes []*Route `json:"routes,omitempty"` | |||
} | |||
|
|||
// Each fluentd config instance will create a route pluginstore. | |||
// NewRoutePlugin Each fluentd config instance will create a route pluginstore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NewRoutePlugin Each fluentd config instance will create a route pluginstore. | |
// Each fluentd config instance will create a route pluginstore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add function names like NewRoutePlugin and NewGlobalRouter to the function's comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the function or parameter name as the beginning of the comment is correct, but we need to ensure that the comment is grammatical. .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that both comments are not grammatical:
NewRoutePlugin Each fluentd config instance will create a route pluginstore.
NewGlobalRouter The global router to store routes Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewRoutePlugin Each fluentd config instance will create a route pluginstore.
NewGlobalRouter The global router to store routes Member
I mean we cannot simply append a function name to the original comments to conform with the guideline, we need to make the entire comment conform the grammar maybe like this:
NewRoutePlugin creates a route pluginstore for each fluentd config instance.
NewGlobalRouter creates a global router to store routes Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
pkg/fluentd/router/pluginstore.go
Outdated
@@ -83,7 +83,7 @@ func (r *Route) NewRoutePlugin() (*params.PluginStore, error) { | |||
return ps, nil | |||
} | |||
|
|||
// The global router to store routes | |||
// NewGlobalRouter The global router to store routes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NewGlobalRouter The global router to store routes | |
// The global router to store routes |
a49ead4
Signed-off-by: fengshunli <1171313930@qq.com>
Thanks for the contribution! |
Signed-off-by: fengshunli 1171313930@qq.com
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: