Answers for "sort int slice in golang"

Go
2

sort int slice in golang

func sortIntSlice() {
	intSlice := sort.IntSlice{6, 2, 3, -6}
	intSlice.Sort()
    fmt.Println(intSlice)	// output:[-6 2 3 6]
}
Posted by: Guest on July-04-2021

Browse Popular Code Answers by Language