Fix DeepSource issues

This commit is contained in:
2022-02-11 15:17:03 +00:00
parent d38a7e126d
commit c64f489c95
3 changed files with 18 additions and 22 deletions

25
Main.go
View File

@@ -33,21 +33,20 @@ func main() {
if input == "" {
fmt.Println("FATAL: No IP address or domain name was specified.")
os.Exit(1)
}
if input == "me" {
input = getLocalIP()
}
if isIPAddress(input) {
printIPInfo(input, wantPrefixes)
} else {
if input == "me" {
input = getLocalIP()
}
var isIPCorrect bool = checkIPSyntax(input)
if isIPCorrect == true {
printIPInfo(input, wantPrefixes)
ipaddress := resolveDNSHostname(input)
if isIPAddress(ipaddress) {
fmt.Println("Domain Name: ", input)
printIPInfo(ipaddress, wantPrefixes)
} else {
ipaddress := resolveDNSHostname(input)
if checkIPSyntax(ipaddress) == true {
fmt.Println("Domain Name: ", input)
printIPInfo(ipaddress, wantPrefixes)
} else {
fmt.Println("Invalid query.")
}
fmt.Println("Invalid query.")
}
}