mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
make SortByField function deprecate
This commit is contained in:
@@ -734,6 +734,7 @@ func SortBy[T any](slice []T, less func(a, b T) bool) {
|
||||
// SortByField return sorted slice by field
|
||||
// slice element should be struct, field type should be int, uint, string, or bool
|
||||
// default sortType is ascending (asc), if descending order, set sortType to desc
|
||||
// This function is deprecated, use Sort and SortBy for replacement
|
||||
func SortByField(slice any, field string, sortType ...string) error {
|
||||
sv := sliceValue(slice)
|
||||
t := sv.Type().Elem()
|
||||
|
||||
Reference in New Issue
Block a user