add brackets to local address string if ipv6

This commit is contained in:
Matthew R. Kasun 2022-09-12 08:53:06 -04:00
parent 9e63c7e3bc
commit f9873020a5

View file

@ -77,6 +77,9 @@ func getPrivateAddr() (string, error) {
if local == "" {
err = errors.New("could not find local ip")
}
if net.ParseIP(local).To16() != nil {
local = "[" + local + "]"
}
return local, err
}