Skip to content

Commit

Permalink
fix: (*connector).lookupIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nekrassov01 committed Jul 10, 2024
1 parent d1094e4 commit da27a18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ func (c *connector) lookupIP(ctx context.Context) {
ctx, cancel := context.WithTimeout(ctx, c.timeout)
defer cancel()
var resolver net.Resolver
ips, err := resolver.LookupIP(ctx, "ip", c.host)
var err error
c.ips, err = resolver.LookupIP(ctx, "ip", c.host)
if err != nil {
c.ips = nil
c.ips = []net.IP{}
}
c.ips = ips
slices.SortFunc(c.ips, func(a, b net.IP) int {
return bytes.Compare(a, b)
})
Expand Down
2 changes: 1 addition & 1 deletion cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func Test_connector_lookupIP(t *testing.T) {
args: args{
ctx: ctx,
},
want: nil,
want: []net.IP{},
},
}
for _, tt := range tests {
Expand Down

0 comments on commit da27a18

Please sign in to comment.