{"id":18553902,"url":"https://github.com/libi/usort","last_synced_at":"2025-05-15T11:34:31.841Z","repository":{"id":50726384,"uuid":"473952956","full_name":"libi/usort","owner":"libi","description":"a simpler golang slice sort library based on Go 1.18+ Generics and Go sort library. 使用 Go 1.18+ 范型和 sort 包实现的自定义切片排序库。","archived":false,"fork":false,"pushed_at":"2022-03-25T11:17:38.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T11:12:45.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-25T09:50:38.000Z","updated_at":"2022-08-01T04:48:25.000Z","dependencies_parsed_at":"2022-09-12T02:21:35.213Z","dependency_job_id":null,"html_url":"https://github.com/libi/usort","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fusort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fusort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fusort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fusort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libi","download_url":"https://codeload.github.com/libi/usort/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254331204,"owners_count":22053131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:18:48.655Z","updated_at":"2025-05-15T11:34:31.803Z","avatar_url":"https://github.com/libi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"usort\n---\na simpler golang slice sort library based on Go 1.18+ Generics and Go sort library.\n\n使用 Go 1.18+ 范型和 sort 包实现的自定义切片排序库。\n\n### Quick Start\n\n```go\ns1 := []int{1,4,3,2}\n\nusort.USort(s1, func(i, j int) bool {\n    return s1[i] \u003e s1[j]\n})\n```\n\n### Complex type\n```go\ntype People struct {\n    Name string\n    Age  int\n}\n\ntom := People{\"tom\", 31}\nlibi := People{\"libi\", 30}\njerry := People{\"jerry\", 25}\n\ns2 := []People{jerry, tom, libi}\n\nusort.USort(s2, func(i, j int) bool {\n    return s2[i].Age \u003e s2[j].Age\n})\n\nfmt.Println(s2)\n// output : [{tom 31} {libi 30} {jerry 25}]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fusort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibi%2Fusort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fusort/lists"}