Skip to content

Commit 031ae9e

Browse files
committed
Minor correction
1 parent 947d9f4 commit 031ae9e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

10-maps/05-map-access-keys/main.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
package main
2-
32
import "fmt"
43

54
func main() {
6-
var employeeSalary = map[string]float64{
7-
"John": 78000.00,
8-
"Steve": 160000.50,
9-
"David": 85000.00,
5+
var personMobileNo = map[string]string{
6+
"John": "+33-8273658526",
7+
"Steve": "+1-8579822345",
8+
"David": "+44-9462834443",
109
}
1110

12-
var salary = employeeSalary["Steve"]
13-
fmt.Printf("Steve's Salary = %f\n", salary)
11+
var mobileNo = personMobileNo["Steve"]
12+
fmt.Println("Steve's Mobile No : ", mobileNo)
1413

1514
// If a key doesn't exist in the map, we get the zero value of the value type
16-
salary = employeeSalary["Jack"]
17-
fmt.Printf("Jack's Salary = %f\n", salary)
18-
}
15+
mobileNo = personMobileNo["Jack"]
16+
fmt.Println("Jack's PhoneNo : ", mobileNo)
17+
}

0 commit comments

Comments
 (0)