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

WIP feat: add option sets whether reset args when reset #1059

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Skyenought
Copy link
Contributor

What type of PR is this?

feat

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional): 添加 WithDisableReuseArgs

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

@Skyenought Skyenought requested review from a team as code owners February 2, 2024 00:25
@Skyenought Skyenought marked this pull request as draft February 2, 2024 00:25
buf []byte
args []argsKV
buf []byte
reuse bool
Copy link
Member

Choose a reason for hiding this comment

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

这里不需要

reuse bool
}

func (a *Args) SetReuseArgs(b bool) {
Copy link
Member

Choose a reason for hiding this comment

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

这里不需要

@@ -74,6 +79,9 @@ func (a *Args) Set(key, value string) {

// Reset clears query args.
func (a *Args) Reset() {
if a.reuse {
a.args = []argsKV{}
Copy link
Member

Choose a reason for hiding this comment

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

这里不需要

@@ -74,6 +79,9 @@ func (a *Args) Set(key, value string) {

// Reset clears query args.
func (a *Args) Reset() {
if a.reuse {
a.args = []argsKV{}
}
a.args = a.args[:0]
}
Copy link
Member

@li-jin-gou li-jin-gou Feb 2, 2024

Choose a reason for hiding this comment

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

允许自定义 Reset 函数的行为即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants