1. 获取本机 IP 地址 package main import ( "fmt" "net" ) // 获取本机网卡IP func getLocalIP() (ipv4 string, err error)