如题,map[string]interface如何转成map[string]string
更多评论
```go
package main
import "fmt"
func main() {
m := map[string]interface{}{
"1": 1,
"2": "2",
"3": 1.2,
}
fmt.Printf("%v\n", f(m))
}
func f(m map[string]interface{}) map[string]string {
ret := make(map[string]string, len(m))
for k, v := range m {
ret[k] = fmt.Sprint(v)
}
return ret
}
```
#2