-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: improve IsMethod #1088
feat: improve IsMethod #1088
Conversation
req.IsPatch() | ||
} | ||
}) | ||
} |
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.
All the methods do the same so just a benchmark for IsGet is fine.
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.
thx. i will change it.
strings.go
Outdated
strConnect = []byte(MethodConnect) //nolint:unused | ||
strOptions = []byte(MethodOptions) //nolint:unused | ||
strTrace = []byte(MethodTrace) //nolint:unused | ||
strPatch = []byte(MethodPatch) //nolint:unused |
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.
If they are unused and unexported you can remove them.
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
@@ -950,7 +950,7 @@ var clientURLResponseChPool sync.Pool | |||
|
|||
func clientPostURL(dst []byte, url string, postArgs *Args, c clientDoer) (statusCode int, body []byte, err error) { | |||
req := AcquireRequest() | |||
req.Header.SetMethodBytes(strPost) | |||
req.Header.SetMethod(MethodPost) |
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.
IT IS BETTER THAN MINE. THX
Thanks! |
improve
IsMethod
i.eIsPost
、IsGet
and so on.benchmark