We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e0e4c0 commit c549a19Copy full SHA for c549a19
20_struct/10_exercises/ninja-level5.go
@@ -0,0 +1,41 @@
1
+package main
2
+
3
+import (
4
+"fmt"
5
+)
6
7
+type person struct {
8
+ fname string
9
+ lname string
10
+ ficf []string
11
+}
12
13
+func main() {
14
+ p1 := person{
15
+ fname: "aj",
16
+ lname: "kul",
17
+ ficf: []string{"kasata", "vanilla"},
18
+ }
19
+ p2 := person{
20
+ fname: "Ro",
21
+ lname: "kul1",
22
+ ficf: []string{"rainbow", "mint", "chocolate"},
23
24
25
+ /*
26
+ fmt.Println(p1)
27
+ for _, icecream := range p1.ficf {
28
+ fmt.Println(icecream)
29
30
+ for _, icecream := range p2.ficf {
31
32
33
+ */
34
35
+ m := map[string]person{
36
+ p1.lname: p1,
37
+ p2.lname: p2,
38
39
40
+ fmt.Println(m["kul"])
41
0 commit comments