Skip to content

Instantly share code, notes, and snippets.

@xvbnm48
Created March 5, 2022 15:41
Show Gist options
  • Save xvbnm48/a7b0a6e0e0891e05b01a839759509a34 to your computer and use it in GitHub Desktop.
Save xvbnm48/a7b0a6e0e0891e05b01a839759509a34 to your computer and use it in GitHub Desktop.
slice map
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