Add more comments, fix snake case vars

This commit is contained in:
2024-06-09 18:43:31 -05:00
parent a5d0e70080
commit 87e7da60fa
3 changed files with 48 additions and 33 deletions

View File

@@ -90,10 +90,10 @@ func doRequest(request *http.Request) (*http.Response, error) {
}
// GetRandomItems returns N random items from the given array.
// The seed_value is used to control the output.
// The seedValue is used to control the output.
// If the array is not a slice, an error is returned.
func GetRandomItems[T any](arr []T, N int, seed_value int64) ([]T, error) {
randgen := rand.New(rand.NewSource(seed_value))
func GetRandomItems[T any](arr []T, N int, seedValue int64) ([]T, error) {
randgen := rand.New(rand.NewSource(seedValue))
arrValue := reflect.ValueOf(arr)
if arrValue.Kind() != reflect.Slice {