Closed dgrr closed 6 years ago
I tested it and your ContentType function is only 50ns faster than mime.TypeByExtension while mime.TypeByExtension loads from system files and is therefor much more dynamic and supports many more extensions. Both don't allocate any memory so the 50ns is too small a difference to add this code and having to maintain it in the future.
The other commits look good, if you could make separate pull requests for those or remove the ContentType commits from this pull request that would be great.
@erikdubbelboer okay, I don't see the mime library. I only search to do easy to fasthttp using standard datatypes of http protocol. I am going to delete this commits.
Done
Thanks.
Is it because https://golang.org/pkg/mime/ is too slow for your use case? I mean ContentType, not fixes.