-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat:WAF 拦截日志支持导出 #7076
feat:WAF 拦截日志支持导出 #7076
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions 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. |
} | ||
return key | ||
} | ||
|
||
func GetWithName(key string, name string) string { | ||
var ( | ||
dataMap = make(map[string]interface{}) |
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.
该代码段的主要问题在于两个地方:
-
函数Get没有接受参数。
在函数GetWithoutParam中,你传递了一个键(key),但未定义任何函数体。 -
函数Name和内容被混在同一个变量名里了;
这些应该是不同类型的字符串(例如:一个名字和一段文字)。
因此,为了改进这段代码,我给出了以下建议:
- 使GetWithKeyName这个更简单地接收名为key的整数值并返回相应的文本作为答案。
- 删除GetWithName中的数据映射块,并将name与text分开存储为不同的变量以避免混淆。
- 如果需要,可以使用Go语言内置类型实现getWithKey或命名变量来更好地区分不同类型的数据。
Quality Gate passedIssues Measures |
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.