GO-读取网页内容(获取外网IP地址)

来源:互联网 发布:流星网络电视2.87破解 编辑:程序博客网 时间:2024/05/08 02:18
func main() {resp, _ := http.Get("http://www.baidu.com")defer resp.Body.Close()io.Copy(os.Stdout, resp.Body)addr, _ := net.InterfaceAddrs()fmt.Printf("内网:%s", addr)}

0 0