-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (33 loc) · 826 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"fmt"
"github.com/cretz/superpose/example/maporder/otherpkg"
)
var someMap = map[string]string{
"foo-key": "foo-val",
"bar-key": "bar-val",
"baz-key": "baz-val",
"qux-key": "qux-val",
}
func main() {
PrintMap()
sortedPrintMap()
// insertionPrintMap()
}
func PrintMap() {
// Can check which dimension we are in
switch {
case inSorted:
fmt.Println("Ordered print map via sorted iteration:")
// case inInsertion:
// fmt.Println("Ordered print map by insertion order:")
default:
fmt.Println("Normal print map:")
}
// Do print
otherpkg.PrintMap(someMap)
}
var sortedPrintMap func() //maporder_sorted:PrintMap
var inSorted bool //maporder_sorted:<in>
// var insertionPrintMap func() //maporder_insertion:PrintMap
// var inInsertion bool //maporder_insertion:<in>