how to reverse array golang
// string teritory
stringArray := strings.Split("you must be pray before learn anything", " ")
fmt.Println("before sort", stringArray)
fmt.Printf("data not sorted %v \n", sort.StringsAreSorted(stringArray))
sort.Sort(sort.Reverse(sort.StringSlice(stringArray)))
fmt.Println("after sort", stringArray)
fmt.Printf("data sorted %v \n", sort.StringsAreSorted(stringArray))
// int teritory
intArray := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
fmt.Println("before sort", intArray)
fmt.Printf("data not sorted %v \n", sort.IntsAreSorted(intArray))
sort.Sort(sort.Reverse(sort.IntSlice(intArray)))
fmt.Println("after sort", intArray)
fmt.Printf("data sorted %v \n", sort.IntsAreSorted(intArray))