File tree Expand file tree Collapse file tree
src/udemy/go_ted/section16 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt"
4+
5+ func main () {
6+ favorites := make (map [string ][]string )
7+
8+ favorites ["bond_james" ] = []string {"shaken, not stirred" , "martinis" , "fast cars" }
9+ favorites ["moneypenny_jenny" ] = []string {"intelligence" , "literature" , "computer science" }
10+ favorites ["no_dr" ] = []string {"cats" , "ice cream" , "sunsets" }
11+
12+ for key , value := range favorites {
13+ fmt .Println ("Record for" , key )
14+ for i , value := range value {
15+ fmt .Printf ("%v - %v\n " , i , value )
16+ }
17+ }
18+ fmt .Println ("-------------------------" )
19+
20+ delete (favorites , "bond_james" )
21+
22+ for key , value := range favorites {
23+ fmt .Println ("Record for" , key )
24+ for i , value := range value {
25+ fmt .Printf ("%v - %v\n " , i , value )
26+ }
27+ }
28+ fmt .Println ("-------------------------" )
29+
30+ }
You can’t perform that action at this time.
0 commit comments