From 3cbd819ba8bcfc89afcac3a09a8ab0d3d36becf2 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Tue, 3 Dec 2024 14:07:36 +0300 Subject: [PATCH] fix linter errors --- main.go | 6 ++++++ main_test.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dfb38bf..4fe65e5 100644 --- a/main.go +++ b/main.go @@ -338,6 +338,8 @@ func runConnection(options *Options, state *runState) { domainName = strings.ReplaceAll(domainName, "{random}", randString(randomLen)) } + log.Debug("Querying %s", domainName) + m := &dns.Msg{ MsgHdr: dns.MsgHdr{ Id: dns.Id(), @@ -352,9 +354,13 @@ func runConnection(options *Options, state *runState) { // Make sure we don't run faster than the pre-defined rate limit. state.rate.Take() + + // Send the DNS query. _, err := u.Exchange(m) if err == nil { + log.Debug("Query %s has been successfully processed", domainName) + _ = state.incProcessed() } else { _ = state.incErrors() diff --git a/main_test.go b/main_test.go index 5354f7d..2f7430e 100644 --- a/main_test.go +++ b/main_test.go @@ -66,7 +66,7 @@ func Test_runWithQueriesFile(t *testing.T) { example.com example.net` filePath := path.Join(os.TempDir(), "queries.txt") - err := os.WriteFile(filePath, []byte(str), 0644) + err := os.WriteFile(filePath, []byte(str), 0600) require.NoError(t, err) defer func() {