-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
✨ v3 (enhancement): add []byte
support to utils.EqualFold
#2029
Conversation
I think it's good idea to use generics for Fiber utils. |
I don't know why, But I find that using
|
by the way i like such changes when the functions can do more and the performance stays the same now can't we remove the old EqualFold function for bytes ? we can also try to replace other old functions with many parameters with configuration items instead of 3-4 arguments so that they are extensible |
Oh, I didn't find there is a |
Please provide enough information so that others can review your pull request:
replace
utils.EqualFold
signature fromfunc EqualFold(b, s string) bool
tofunc EqualFold[S byteSeq](b, s S) bool
and add a private interface to utils.
Explain the details for making this change. What existing problem does the pull request solve?
this will make
utils.EqualFold
support comparing bytes likebytes.EqualFold
And golang compiler will go monomorphization, which we will have a zero performance cost.
We can also make function like
Trim*
to be generic functions too but I'd like to just change this first for discussion.Commit formatting
Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/
before:
after: