1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: leaderboard aggregation functionality

feat: leaderboard ui design
This commit is contained in:
Ferdinand Mütsch
2022-10-03 23:52:22 +02:00
parent 1d7ff4bc2a
commit a27fe04919
17 changed files with 216 additions and 19 deletions

View File

@@ -53,3 +53,10 @@ func ParseUserAgent(ua string) (string, string, error) {
}
return groups[0][1], groups[0][2], nil
}
func SubSlice[T any](slice []T, from, to uint) []T {
if int(to) > len(slice) {
to = uint(len(slice))
}
return slice[from:int(to)]
}