Skip to content

Commit 5ef836e

Browse files
committed
fix: added comments in getIP and client/config.go
1 parent 42d3a26 commit 5ef836e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ type Config struct {
6060
// Expected format is {protocol}://{host}:{port}, e.g. tcp://8.8.8.8:53
6161
DNSResolver string `yaml:"dns-resolver,omitempty"`
6262

63+
// DNSResolverConfig is parsed DNSResolver
64+
// We do this to avoid parsing DNSResolver every time it is needed
6365
DNSResolverConfig *DNSResolverConfig `yaml:"-"`
6466

6567
// OAuth2Config is the OAuth2 configuration used for the client.

config/endpoint/endpoint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ func (e *Endpoint) getParsedBody() string {
433433
}
434434

435435
func (e *Endpoint) getIP(result *Result) {
436-
437436
resolver := net.DefaultResolver
438-
437+
// Create a custom DNS resolver for use in looking up the IP address
438+
// if the configuration specifies a custom DNS resolver address
439439
if e.ClientConfig.HasCustomDNSResolver() {
440440
dnsResolver := e.ClientConfig.DNSResolverConfig
441441
resolver = &net.Resolver{

0 commit comments

Comments
 (0)