当前位置: 首页 > 工具软件 > go-bip39 > 使用案例 >

Go实战--golang中获取公网ip、查看内网ip、检测ip类型、校验ip区间、ip地址string和int转换、根据ip判断地区国家运营商等

赵镜
2023-12-01

生命不止,继续 go go go!!!

之前,有介绍过golang提供的标准库:net包

Go语言学习之net包(The way to go)

简要回味net包

func ParseIP

func ParseIP(s string) IP

ParseIP parses s as an IP address, returning the result. The string s can be in dotted decimal (“192.0.2.1”) or IPv6 (“2001:db8::68”) form. If s is not a valid textual representation of an IP address, ParseIP returns nil.

func InterfaceAddrs

func InterfaceAddrs() ([]Addr, error)

InterfaceAddrs returns a list of the system’s

 类似资料: