Skip to content
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

Merged
merged 1 commit into from
Nov 15, 2024
Merged

feat:WAF 拦截日志支持导出 #7076

merged 1 commit into from
Nov 15, 2024

Conversation

zhengkunwang223
Copy link
Member

No description provided.

Copy link

f2c-ci-robot bot commented Nov 15, 2024

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{})

Choose a reason for hiding this comment

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

该代码段的主要问题在于两个地方:

  1. 函数Get没有接受参数。
    在函数GetWithoutParam中,你传递了一个键(key),但未定义任何函数体。

  2. 函数Name和内容被混在同一个变量名里了;
    这些应该是不同类型的字符串(例如:一个名字和一段文字)。

因此,为了改进这段代码,我给出了以下建议:

  1. 使GetWithKeyName这个更简单地接收名为key的整数值并返回相应的文本作为答案。
  2. 删除GetWithName中的数据映射块,并将name与text分开存储为不同的变量以避免混淆。
  3. 如果需要,可以使用Go语言内置类型实现getWithKey或命名变量来更好地区分不同类型的数据。

Copy link
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Member

/approve

Copy link

f2c-ci-robot bot commented Nov 15, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit a16810e into dev-v2 Nov 15, 2024
6 checks passed
@f2c-ci-robot f2c-ci-robot bot deleted the pr@dev-v2@common branch November 15, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants