Simplify random.Int64 usage with generics

This commit is contained in:
Deluan 2024-05-11 20:10:46 -04:00
parent 0ae2944073
commit 3463d0c208
4 changed files with 7 additions and 5 deletions

View file

@ -42,7 +42,7 @@ func (s Share) CoverArtID() ArtworkID {
case "artist":
return Artist{ID: ids[0]}.CoverArtID()
}
rnd := random.Int64(int64(len(s.Tracks)))
rnd := random.Int64(len(s.Tracks))
return s.Tracks[rnd].CoverArtID()
}