```
package main
import "fmt"
type IPAddr [4]byte
// TODO: Add a "String() string" method to IPAddr.
func main() {
addrs := map[string]IPAddr{
"loopback": {127, 0, 0, 1},
"googleDNS": {8, 8, 8, 8},
}
for n, a := range addrs {
fmt.Printf("%v: %v\n", n, a)
for _, x := range a {
y := int(x)
fmt.Println(string(y))
}
}
}
```
结果显示,打印空白了?
loopback: [127 0 0 1]
�
�
googleDNS: [8 8 8 8]
为什么不能用string转字符串
更多评论