We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Fiber version
v2.27.0
Issue description
follow-up questions: #1774
utils.TrimBytes([]byte(" "), ' ') got []byte(" ") instead of []byte("")
utils.TrimBytes([]byte(" "), ' ')
[]byte(" ")
[]byte("")
Code snippet
package main_test import ( "bytes" "testing" "github.com/gofiber/fiber/v2/utils" ) func TestShouldBeEmptyBytes(t *testing.T) { res := bytes.Trim([]byte(" "), " ") utils.AssertEqual(t, 0, len(res)) // this is right res = bytes.Trim([]byte(" "), " ") utils.AssertEqual(t, 0, len(res)) // this is right res = utils.TrimBytes([]byte(" "), ' ') utils.AssertEqual(t, 0, len(res)) // this is wrong, result is 1 res = utils.TrimBytes([]byte(" "), ' ') utils.AssertEqual(t, 0, len(res)) // this is wrong, result is 1 res = utils.TrimBytes([]byte(""), ' ') utils.AssertEqual(t, 0, len(res)) }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Fiber version
v2.27.0
Issue description
follow-up questions: #1774
utils.TrimBytes([]byte(" "), ' ')
got[]byte(" ")
instead of[]byte("")
Code snippet
The text was updated successfully, but these errors were encountered: