Skip to content

Commit

Permalink
Merge pull request #103 from glazychev-art/fix_get_dns_ip
Browse files Browse the repository at this point in the history
Fix getDNSServerIP function
  • Loading branch information
denis-tingaikin authored Jul 29, 2022
2 parents a0e11d0 + 6fe7900 commit 6bd5001
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,12 @@ func main() {
logrus.SetFormatter(&nested.Formatter{})

var dnsServerIP = new(atomic.Value)
dnsServerIP.Store(net.IP(nil))
config.getDNSServerIP = func() net.IP { return dnsServerIP.Load().(net.IP) }
config.getDNSServerIP = func() net.IP {
if ip := dnsServerIP.Load(); ip != nil {
return ip.(net.IP)
}
return nil
}

// ********************************************************************************
// Configure Open Telemetry
Expand Down

0 comments on commit 6bd5001

Please sign in to comment.