Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import (
- "fmt"
- "github.com/davecgh/go-spew/spew"
- )
- type wpInfo struct {
- width string
- height string
- arr []map[string]string
- }
- func main() {
- w := wpInfo{width: "very wide", height: "extremely tall"}
- aom1 := map[string]string{"one": "inky", "two": "rinky", "three": "doo"}
- aom2 := map[string]string{"one": "dinky", "two": "parlay", "three": "voo"}
- w.arr = append(w.arr, aom1)
- w.arr = append(w.arr, aom2)
- spew.Dump(w.arr)
- spew.Dump(w)
- fmt.Println("---------------------------")
- for i := range w.arr {
- fmt.Printf("Row: %v\n", i)
- for idx, j := range w.arr[i] {
- fmt.Printf("[%v] [%s]\n", idx, j)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement