Standard library / sort
sort.IntSlice.Sort()
Sorts the receiver in ascending order in place; does not guarantee stability. Expected stdout: '[1 2 3]\n'.
Formal Syntax & Structure
go syntaxgo
func (x IntSlice) Sort()Working Example
Example Snippetgo
package main
import ( "fmt" "sort")
func main() { a := sort.IntSlice([]int{3, 1, 2}) a.Sort() fmt.Println(a)}