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
https://github.com/gofiber/fiber/blob/master/utils/convert.go#L24 https://github.com/gofiber/fiber/blob/master/internal/fasttemplate/unsafe.go#L15
See: https://stackoverflow.com/questions/59209493/how-to-use-unsafe-get-a-byte-slice-from-a-string-without-memory-copy
The current implementations may not be as future proof as it could be according to the discussion in the link above.
They propose:
func unsafeGetBytes(s string) []byte { if s == "" { return nil // or []byte{} } return (*[0x7fff0000]byte)(unsafe.Pointer( (*reflect.StringHeader)(unsafe.Pointer(&s)).Data), )[:len(s):len(s)] }
N/A
No response
The text was updated successfully, but these errors were encountered:
Agree with you. I think we should use recommended solution.
Sorry, something went wrong.
The initial functions were copies of the fasthttp functions, we should open a topic there too
Furthermore we should comment the line with the magic limit and determine this number outside on a constant one
Successfully merging a pull request may close this issue.
Bug Description
https://github.com/gofiber/fiber/blob/master/utils/convert.go#L24
https://github.com/gofiber/fiber/blob/master/internal/fasttemplate/unsafe.go#L15
See: https://stackoverflow.com/questions/59209493/how-to-use-unsafe-get-a-byte-slice-from-a-string-without-memory-copy
The current implementations may not be as future proof as it could be according to the discussion in the link above.
They propose:
How to Reproduce
N/A
Expected Behavior
N/A
Fiber Version
N/A
Code Snippet (optional)
No response
Checklist:
The text was updated successfully, but these errors were encountered: