Skip to Content

Golang – maps on map, multimap example

Posted on

 

package main

import "fmt"

func main() {
  var wan map[int]map[string]string
  wan = make( map[int]map[string]string )

  wan[1] = make(map[string]string)
  wan[1]["int"] = "eth1"

  fmt.Println(wan)
  fmt.Println( wan[1]["int"] )
}

result :

map[1:map[int:eth1]] eth1