Application
Create new folder named src. In src folder, create new file named main.go as below:
package main
import "fmt"
func main() {
student := map[string]string{
"id": "st01",
"name": "name 1",
"address": "address 1",
}
Display(student)
}
func Display(student map[string]string) {
for key, value := range student {
fmt.Println(key, ":", value)
}
}
Output
Open Terminal windows in Visual Studio Code and run command line: go run main.go
id: st01
name: name 1
address: address 1