this is what I've got so far, the print statements are just there to see what the list looks like
package main
import(
"fmt"
"math/rand"
)
func main() {
fmt.Println("Hello world")
var randomList [10]int
randomList = [10]int(generateRandArray(len(randomList), 100)) // not entirely sure of the [10]int does here, gopls inserted it (thanks)
}
func generateRandArray(listLength int, maxNum int) []int { // here i think the []int describes the return type but not entirely sure
returnList := make([]int, listLength)
fmt.Print("[")
for i := 0; i<listLength-1; i++{
returnList[i] = rand.Intn(maxNum)
fmt.Print(returnList[i], ",")
}
returnList[listLength-1] = rand.Intn(10)
fmt.Print(returnList[listLength-1])
fmt.Println("]")
return returnList
}
So far it works but I have like 2 comments of things im not sure about, help and criticism is appreciated