Golang ProgramsGolang Programs

How to create Map using the make function in Go?

A map value can also be initialized using the make function.
package main

import "fmt"

func main() {
    var employee = make(map[string]int)
    employee["Mark"] = 10
    employee["Sandy"] = 20
    fmt.Println(employee)
    
    employeeList := make(map[string]int)
    employeeList["Mark"] = 10
    employeeList["Sandy"] = 20
    fmt.Println(employeeList)
}
C:\golang\maps>go run example1.go
map[Mark:10 Sandy:20]
map[Sandy:20 Mark:10]

C:\golang\maps>