fork(1) download
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. type IPAddr [4]byte
  6.  
  7. func (v IPAddr) String() string {
  8. return "0.0.0.0"
  9. }
  10.  
  11. func main() {
  12. hosts := map[string]IPAddr{
  13. "loopback": {127, 0, 0, 1},
  14. "googleDNS": {8, 8, 8, 8},
  15. }
  16. for name, ip := range hosts {
  17. fmt.Printf("%v: %v\n", name, ip)
  18. }
  19. }
  20.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
loopback: 0.0.0.0
googleDNS: 0.0.0.0