mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-22 16:58:54 +02:00
simplify icon caching and homepage item override
This commit is contained in:
@@ -18,3 +18,11 @@ func Intersect[T comparable, Slice ~[]T](slice1 Slice, slice2 Slice) Slice {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// Slice returns a slice of the first n elements in slice like javascript's slice.
|
||||
func Slice[T any](slice []T, n int) []T {
|
||||
if n >= len(slice) {
|
||||
return slice
|
||||
}
|
||||
return slice[:n]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user