fix: ip变量类型问题

This commit is contained in:
Mmx
2021-12-03 20:22:41 +08:00
parent 7490e8c385
commit 4ade00cb54
2 changed files with 5 additions and 2 deletions

View File

@@ -30,7 +30,10 @@ func GetInterfaceAddr() ([]srunModels.Eth, error) {
if strings.Contains(ip.String(), ".") {
result = append(result, srunModels.Eth{
Name: eth.Name,
Addr: ip,
Addr: func() *net.TCPAddr {
n, _ := net.ResolveTCPAddr("tcp", ip.String())
return n
}(),
})
break
}