* all: use sort.Strings when applicable
Basically, sort.Strings is the shortcut of Sort(StringSlice(a)) but its
more readable.
* all: replace string(bytes.Buffer.Bytes()) with bytes.Buffer.String()
Although its only occured on test files, it may be worth to simplified it.
* http_test: simplify strings.Index with strings.Contains
Both have the same O(n), but strings.Contains more readable on
if-condition.
* args: simplify if-condition check on boolean value
* all: simplify variable initialization
If we assign the variable after declaring it, we can simplify it using
":=" operator or "= value".
The reader can still known the type of variable from the struct name or
variable type before assignment operator.
This fix is based on suggestion of "prealloc" static analysis tool [1].
Per note of the tool's author suggestion, its recommended to allocate the
slice length/capability, if we known their possible size. This is to
minimize "append" to re-allocate the slice underlying array.
[1] https://github.com/alexkohler/prealloc
* add method StringSort QueryStringSort AppendBytesSort in args
* simplify code
* only Sort method
* format
* add method StringSort QueryStringSort AppendBytesSort in args
* simplify code
* only Sort method
* format
* merge and fix tests
* change sort into generic by having the sort function
* change sort into generic by having the sort function
* change comment
Don't return an error response if a keep-alive connection closes either
because the other side closed the connection or a read timeout occurs.
This will prevent net/http from printing
"Unsolicited response received on idle HTTP channel"
when a ReadTimeout is set on the fasthttp Server.
Fixes#465
Not doing this means people using Client can still inspect the response
headers when reading the body fails (for example when it is too big).
fixes#456
As you can see here https://golang.org/src/crypto/tls/conn.go#L1041
crypto/tls.Conn does not perform a TLS handshake until Read or Write functions are called.
Then the solution is to call crypto/tls.Conn.Handshake() to check Client values.