title: How to modify map in go
body: <p>I am trying to modify the IPAddr for the "loopback", but it seems cannot access the element directly. </p>
  
  <pre><code>addrs["loopback"][0] = byte(2) //cannot assign to addrs["loopback"][0]
  </code></pre>
  
  <p>How can I do it within go?</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type IPAddr [4]byte
  
  func main() {
      addrs := map[string]IPAddr{
          "loopback":  {127, 0, 0, 1},
          "googleDNS": {8, 8, 8, 8},
      }
      addrs["loopback"][0] = byte(2)
      for n, a := range addrs {
          fmt.Printf("%v: %v\n", n, a)
      }
  }
  </code></pre>