We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99ed61e commit d85ab13Copy full SHA for d85ab13
main.go
@@ -132,14 +132,18 @@ func ParseDnsx(filename string) map[string][]string {
132
var result map[string]interface{}
133
json.Unmarshal([]byte(scanner.Text()), &result)
134
host := result["host"].(string)
135
- aRecords := result["a"].([]interface{})
136
- ip := ""
137
138
- for _, record := range aRecords {
139
- ip = record.(string)
140
- }
+ if val, ok := result["a"]; ok {
+ aRecords := val.([]interface{})
+
+ ip := ""
141
142
- data[ip] = append(data[ip], host)
+ for _, record := range aRecords {
+ ip = record.(string)
143
+ }
144
145
+ data[ip] = append(data[ip], host)
146
147
}
148
149
if err := scanner.Err(); err != nil {
0 commit comments