Simplify random.Int64 usage with generics
This commit is contained in:
@@ -51,7 +51,7 @@ func (h *Handler) getRandomImage(ctx context.Context) (string, error) {
|
||||
if len(list) == 0 {
|
||||
return "", errors.New("no images available")
|
||||
}
|
||||
rnd := random.Int64(int64(len(list)))
|
||||
rnd := random.Int64(len(list))
|
||||
return list[rnd], nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user