We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe I'm missing something, but StringSlice seems broken. The documentation of sort.Strings says
sort.Strings
Strings sorts a slice of strings in increasing order.
so I would exptect that it would sort by length instead of comparing lexically byte-wise.
Example:
a := []string{"A", "Ab", "Abc", "Abcd", "Xyz", "Yz", "Z"} b := []string{"", "Hello", "foo", "bar", "foo", "f00", "%*&^*&^&", "***"}
Expect:
a = ["A", "Z", "Ab", "Yz", "Abc", "Xyz", "Abcd"] b = ["", "***", "bar", "foo", "foo", "f00", "Hello", "%*&^*&^&"]
Got:
a = ["A", "Ab", "Abc", "Abcd", "Xyz", "Yz", "Z"] b = ["", "%*&^*&^&", "***", "Hello", "bar", "f00", "foo", "foo"]
Note that the test case just tests that the input is sorted instead of comparing it against a expected fixture.
The text was updated successfully, but these errors were encountered:
Working as intended. Increasing means lexicographically increasing here. We might want to update the docs.
Sorry, something went wrong.
Actually, the docs look pretty clear. The ordering is just < on strings.
No branches or pull requests
Maybe I'm missing something, but StringSlice seems broken. The documentation of
sort.Strings
saysso I would exptect that it would sort by length instead of comparing lexically byte-wise.
Example:
Expect:
Got:
Note that the test case just tests that the input is sorted instead of comparing it against a expected fixture.
The text was updated successfully, but these errors were encountered: