use better variable names
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-12-10 15:07:19 +01:00
parent 740f0e6082
commit a38a03c959
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD

16
main.go
View file

@ -91,12 +91,12 @@ func run(args []string) (opts *util.Options, code int, err error) {
fmt.Println(str)
if keepTracing {
var nothing []dns.RR
var records []dns.RR
if opts.Request.Name == "." {
nothing = resp.DNS.Answer
records = resp.DNS.Answer
} else {
nothing = resp.DNS.Ns
records = resp.DNS.Ns
}
want := func(rr dns.RR) bool {
@ -107,17 +107,17 @@ func run(args []string) (opts *util.Options, code int, err error) {
i := 0
for _, x := range nothing {
for _, x := range records {
if want(x) {
nothing[i] = x
records[i] = x
i++
}
}
nothing = nothing[:i]
nothing2 := nothing[r.Intn(len(nothing))]
records = records[:i]
randomRR := records[r.Intn(len(records))]
v := strings.Split(nothing2.String(), "\t")
v := strings.Split(randomRR.String(), "\t")
opts.Request.Server = strings.TrimSuffix(v[len(v)-1], ".")
opts.TLS = false