Skip to content

Commit

Permalink
Remove unused struct.
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Ying <[email protected]>
  • Loading branch information
yegle committed Jan 5, 2021
1 parent d08e1b0 commit 5b10683
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions prober/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package prober

import (
"context"
"errors"
"fmt"
"hash/fnv"
"net"
Expand All @@ -32,23 +31,6 @@ var protocolToGauge = map[string]float64{
"ip6": 6,
}

type resolver struct {
net.Resolver
}

// A simple wrapper around resolver.LookupIP.
func (r *resolver) resolve(ctx context.Context, target string, protocol string) (*net.IPAddr, error) {
ips, err := r.LookupIP(ctx, protocol, target)
if err != nil {
return nil, err
}
for _, ip := range ips {
return &net.IPAddr{IP: ip}, nil
}
// Go doc did not specify when this could happen, better be defensive.
return nil, errors.New("calling LookupIP returned empty list of addresses")
}

// Returns the IP for the IPProtocol and lookup time.
func chooseProtocol(ctx context.Context, IPProtocol string, fallbackIPProtocol bool, target string, registry *prometheus.Registry, logger log.Logger) (ip *net.IPAddr, lookupTime float64, err error) {
var fallbackProtocol string
Expand Down

0 comments on commit 5b10683

Please sign in to comment.