Debian Codegraph @

_test/map11.go

raw symbols SCIP
1 package main
2
3 import (
4 "fmt"
5 "sort"
6 )
7
8 type Foo struct {
9 Name string
10 }
11
12 func main() {
13 m := map[string][]Foo{
14 "hello": []Foo{{"foo"}, {"bar"}},
15 "world": []Foo{{"truc"}, {"machin"}},
16 }
17
18 var content []string
19
20 for key, values := range m {
21 for _, value := range values {
22 content = append(content, key+value.Name)
23 }
24 }
25
26 sort.Strings(content)
27 fmt.Println(content)
28 }
29
30 // Output:
31 // [hellobar hellofoo worldmachin worldtruc]