Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Dec 3, 2024
1 parent ddeb9f0 commit 3cbd819
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3cbd819

Please sign in to comment.