Skip to content

Commit 95540b7

Browse files
authored
fix consul watcher address handling (#2800)
1 parent be2559c commit 95540b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

registry/consul/watcher.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package consul
22

33
import (
4-
"fmt"
5-
"net"
64
"sync"
75

86
"github.com/hashicorp/consul/api"
97
"github.com/hashicorp/consul/api/watch"
108
"go-micro.dev/v5/registry"
9+
mnet "go-micro.dev/v5/util/net"
1110
regutil "go-micro.dev/v5/util/registry"
1211
)
1312

@@ -106,7 +105,7 @@ func (cw *consulWatcher) serviceHandler(idx uint64, data interface{}) {
106105

107106
svc.Nodes = append(svc.Nodes, &registry.Node{
108107
Id: id,
109-
Address: net.JoinHostPort(address, fmt.Sprint(e.Service.Port)),
108+
Address: mnet.HostPort(address, e.Service.Port),
110109
Metadata: decodeMetadata(e.Service.Tags),
111110
})
112111
}

0 commit comments

Comments
 (0)