在Golang中检查IP地址切片中IP的有效方法

I'm developing a network application in Golang. I have a slice of IP addresses. Each time a request comes I use net.LookupIP(host) to find out IP address of host which returns a slice of net.IP. What is the best approach to compare these?

By the way in Python we have a set data structure which makes above question so easy to resolve but what about Go?

查看全部
duanjiangzhi6851
duanjiangzhi6851
2016/08/31 11:13
  • slice
  • ip
  • arrays
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复