Closed johnrs closed 9 years ago
Can't reproduce
package main
import (
"log"
"sort"
"github.com/xlab/handysort"
)
func main() {
a := []string{"a", "a", "a", "a1", "a1", "a1", "a1", "a1x"}
sort.Sort(handysort.Strings(a))
log.Println(a) // => [a a a a1 a1 a1 a1 a1x]
}
Strange! Here is what I see when I run the exact code you posted.
2015/04/12 13:17:42 [a a a a1 a1x a1 a1 a1]
I'm running ver 1.4.2 windows/amd64 on Windows 7.
Alright, I've rearranged the input, bug showed itself up.
Thanks for these reports.
I ran across this result by accident. It is very sensitive to the amount and position of the data.
[]string{"a", "a", "a", "a1", "a1", "a1", "a1", "a1x"} ==> [a a a a1 a1x a1 a1 a1]