Created
March 5, 2022 15:41
-
-
Save xvbnm48/a7b0a6e0e0891e05b01a839759509a34 to your computer and use it in GitHub Desktop.
slice map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
// slice of map | |
students := []map[string]string{ | |
{"name": "sakura", "age": "20", "address": "jepang"}, | |
{"name": "aruno", "age": "20", "address": "jepang"}, | |
{"name": "sakura endo", "age": "20", "address": "jepang"}, | |
} | |
// fmt.Println(students) | |
for _, student := range students { | |
// fmt.Println(student) | |
fmt.Println(student["name"], "umurnya", student["age"], "asal dari ", student["address"]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment