You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: arrutil.go
    path of file: ./repos/goutil/arrutil
    
    the code of the file until where you have to start completion: // Package arrutil provides some util functions for array, slice
    
func RandomOne[T any](arr []T) T {
	if ln := len(arr); ln > 0 {
		i := mathutil.RandomInt(0, len(arr))
		return arr[i]
	}
	panic("cannot get value from nil or empty slice")
}