✨ v3 (enhancement): add []byte support to utils.EqualFold#2029
Merged
ReneWerner87 merged 2 commits intogofiber:v3-betafrom Aug 19, 2022
Merged
✨ v3 (enhancement): add []byte support to utils.EqualFold#2029ReneWerner87 merged 2 commits intogofiber:v3-betafrom
[]byte support to utils.EqualFold#2029ReneWerner87 merged 2 commits intogofiber:v3-betafrom
Conversation
Member
|
I think it's good idea to use generics for Fiber utils. |
Contributor
Author
|
I don't know why, But I find that using |
Member
|
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 |
Contributor
Author
|
Oh, I didn't find there is a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please provide enough information so that others can review your pull request:
replace
utils.EqualFoldsignature fromfunc EqualFold(b, s string) booltofunc EqualFold[S byteSeq](b, s S) booland 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.EqualFoldsupport comparing bytes likebytes.EqualFoldAnd 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: