Observe the code below:
Note: Assume all the necessary imports are done.
func main() {
var order = map[string]int{}
customer := "Premium"
switch customer {
case "[A-Z][a-z]{6}": //line1
order["Noodles"] = 2

case "Premium", "Regular":
order["Pizza"] = 2

default:
order["Pizza"] = 0
order["Noodles"] = 0
order["Pasta"] = 0
}
if _, flag := order["Pasta"]; !flag {
order["Pasta"] = 0
}
_, flag := order["Pasta"]
fmt.Println(flag)
}

What is the above output?

true map[Pasta:0 Pizza:2]

true map[Noodles:2 Pasta:0]

false map[Pasta:0 Pizza:2]

false map[Noodles:2 Pasta:0]

Correct Option - a

To get all Infosys Certified Go Programmer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in