1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-09-16 08:36:30 +02:00

Check ipv4 or ipv6 address is valid before assigning

This commit is contained in:
Dominic Wong
2020-05-27 15:18:03 +01:00
parent 192f548c83
commit e7ad031eb8
2 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ type ServiceEntry struct {
// complete is used to check if we have all the info we need
func (s *ServiceEntry) complete() bool {
return (s.AddrV4 != nil || s.AddrV6 != nil || s.Addr != nil) && s.Port != 0 && s.hasTXT
return (len(s.AddrV4) > 0 || len(s.AddrV6) > 0 || len(s.Addr) > 0) && s.Port != 0 && s.hasTXT
}
// QueryParam is used to customize how a Lookup is performed