si3nloong / raptor

Slim and fast like a raptor
MIT License
9 stars 0 forks source link

Please do use github.com/valyala/fasthttp. #15

Closed zypeh closed 5 years ago

zypeh commented 5 years ago
# This fork has been deprecated.
[[constraint]]
  branch = "master"
  name = "github.com/erikdubbelboer/fasthttp" 

# And this fork is using the deprecated fasthttp fork above.
[[constraint]]
  name = "github.com/thehowl/fasthttprouter" 
  version = "0.2.1"

I do suggest using github.com/valyala/fasthttp for better support and updates. As I see there is no strong reason to use the fasthttprouter also.

Instead will introduce unsound problem/compatibility problem for later go versions. *1

  1. Using unsafe pointer to avoid []byte to string conversion in thehowl/fasthttprouter
zypeh commented 5 years ago

Basically it is just unsafe pointer casting the reflect.SliceHeader to reflect.StringHeader, since it is same length in runtime. But Go does not specify the length of reflect struct field, and may be subject to change.

si3nloong commented 5 years ago

Thank for the suggestion, changes had been updated to feature/validate