1 Star 0 Fork 0

wu-chj/ops

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
GetIP.go 279 Bytes
一键复制 编辑 原始数据 按行查看 历史
wu-chj 提交于 2023-11-27 16:34 +08:00 . update utils/GetIP.go.
package utils
import (
"strings"
"net"
)
func GetIP() (strings error) {
conn,err := net.Dial("tcp","google.com:80")
if err != nil {
return "err",err
}
defer conn.Close()
return strings.Split(conn.LocalAddr().strings)[0],nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/wu-chj/ops.git
git@gitee.com:wu-chj/ops.git
wu-chj
ops
ops
8fd364b2a7fb

搜索帮助