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 2ea39c3 commit 0c33ce6Copy full SHA for 0c33ce6
codes/ch5_maps/insert-into-a-map.go
@@ -0,0 +1,27 @@
1
+package main
2
+
3
+import "fmt";
4
5
+func GetPrefix(name string) (prefix string) {
6
7
+ var prefixMap map[string] string
8
+ prefixMap = make(map[string] string)
9
10
+ /**
11
+ * Insert key and value into the map.
12
+ *
13
+ * <map-variable>[<key>] = <value>
14
+ */
15
+ prefixMap["Ashwin"] = "Sr. Fullstack Engineer"
16
+ prefixMap["Kumar"] = "Sr. Engineering Manager"
17
+ prefixMap["Saju"] = "Sr. Solution Architect"
18
+ prefixMap["Ajay"] = "Sr. solution Architect"
19
20
+ return prefixMap[name]
21
+}
22
23
+func main() {
24
25
+ fmt.Println("What is Ashwin's role? He is " + GetPrefix("Ashwin"))
26
27
0 commit comments