Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1.  
  2. import (
  3. "fmt"
  4. "github.com/davecgh/go-spew/spew"
  5. )
  6.  
  7. type wpInfo struct {
  8. width string
  9. height string
  10. arr []map[string]string
  11. }
  12.  
  13. func main() {
  14.  
  15. w := wpInfo{width: "very wide", height: "extremely tall"}
  16.  
  17. aom1 := map[string]string{"one": "inky", "two": "rinky", "three": "doo"}
  18. aom2 := map[string]string{"one": "dinky", "two": "parlay", "three": "voo"}
  19.  
  20. w.arr = append(w.arr, aom1)
  21. w.arr = append(w.arr, aom2)
  22.  
  23. spew.Dump(w.arr)
  24. spew.Dump(w)
  25.  
  26. fmt.Println("---------------------------")
  27. for i := range w.arr {
  28. fmt.Printf("Row: %v\n", i)
  29. for idx, j := range w.arr[i] {
  30. fmt.Printf("[%v] [%s]\n", idx, j)
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement