miracle-sort/main.go

23 lines
338 B
Go

package main
import "fmt"
func main() {
// This is the map we want to sort
m := make(map[int]string)
m[0] = "first"
m[1] = "second"
m[2] = "third"
m[3] = "fourth"
m[4] = "fifth"
m[5] = "sixth"
m[6] = "seventh"
m[7] = "eighth"
m[8] = "nineth"
m[9] = "tenth"
for index, msg := range m {
fmt.Println(index, ": ", msg)
}
}