title: Golang iterate a nested map and change keys to Title case
body: <p>I have a nested map with <code>lower</code> case characters. What I want to do is to iterate on the map and convert all the keys to <code>Title</code> case. I tried the following code below, but it is giving me weird results. Can someone guide me where I am going wrong?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "strings"
  )
  
  func main() {
      a := make(map[string]interface{})
  
      a["start"] = map[string]interface{}{
          "hello": 2,
          "world": 3,
          "here": map[string]interface{}{
              "baam": 123,
              "boom": "dsd",
          },
      }
  
      printMap(a)
  
      fmt.Println(a)
  }
  
  func printMap(a map[string]interface{}) {
  
      for k, v := range a {
  
          switch v.(type) {
          case map[string]interface{}:
              printMap(v.(map[string]interface{}))
          default:
              title := strings.Title(k)
              a[title] = a[k]
              delete(a, k)
          }
      }
  }
  </code></pre>