code: func activeInterfaceAddresses() ([]net.Addr, error) {
  	var upAddrs []net.Addr
  	var loAddrs []net.Addr
  
  	interfaces, err := net.Interfaces()
  	if err != nil {
  		return nil, fmt.Errorf("Failed to get interfaces: %v", err)
  	}
  
  	for _, iface := range interfaces {
  		// Require interface to be up
  		if iface.Flags&net.FlagUp == 0 {
  			continue
  		}
  
  		addresses, err := iface.Addrs()
  		if err != nil {
  			return nil, fmt.Errorf("Failed to get interface addresses: %v", err)
  		}
  
  		if iface.Flags&net.FlagLoopback != 0 {
  			loAddrs = append(loAddrs, addresses...)
  			continue
  		}
  
  		upAddrs = append(upAddrs, addresses...)
  	}
  
  	if len(upAddrs) == 0 {
  		return loAddrs, nil
  	}
  
  	return upAddrs, nil
  }
docs: // Returns addresses from interfaces that is up