Support numeric sort in ByParam
authorAnton Harniakou <anton.harniakou@gmail.com>
Tue, 15 Jan 2019 12:41:54 +0000 (15:41 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 20 Jan 2019 13:05:20 +0000 (13:05 +0000)
commit26f75edb7a76c816349749a05edf98fb36dc338a
treeb06c8f6791306c287f26fe75b2a195152760d360
parente1a66c7343db9d232749255dd9e3a58d94b86997
Support numeric sort in ByParam

With this commit ByParam takes into account a type of a value under a
key. If both values are numeric then they're coerced into float64 and
then get compared.
If any value isn't numeric, for example it's nil or string, then both
values coerced into string and get compared as strings
(lexicographicaly)

Nil values are always sent to the end.

Numeric values confirm to any type listed below:
uint8, uint16, uint32, uint64, int, int8, int16, int32, int64, float32, float64

Closes #5305
hugolib/pageSort.go
hugolib/pageSort_test.go