gobyexample/084-sort.go
Mark McGranaghan 5a2e750fe1 sort code
2012-09-21 08:55:45 -07:00

21 lines
252 B
Go

package main
import "fmt"
import "sort"
func main() {
strs := []string{"c", "a", "b"}
sort.Strings(strs)
fmt.Println(strs)
ints := []int{7, 2, 4}
sort.Ints(ints)
fmt.Println(ints)
}
/*
$ go run sort.go
[foo bar bat]
[2 4 7]
*/