A series of universal tools for go projects.
using splitseq
1 file changed, +1 -1
+1-1querytools/orderby.go
| @@ -33,7 +33,7 @@ func (ob *OrderBy) Append(field OrderByField) { | ||
| 33 | 33 | |
| 34 | 34 | func OrderByFromString(allowed_fields map[string]struct{}, s string) OrderBy { |
| 35 | 35 | ob := OrderBy{} |
| 36 | - for _, raw := range strings.Split(s, ",") { | |
| 36 | + for raw := range strings.SplitSeq(s, ",") { | |
| 37 | 37 | dir := "ASC" |
| 38 | 38 | if raw[0] == '-' { |
| 39 | 39 | raw = raw[1:] |