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

11
API.go
View File

@@ -19,15 +19,12 @@ func getLocalIP() string {
return ""
}
body, _ := ioutil.ReadAll(resp.Body)
return string(body[:])
return string(body)
}
func checkIPSyntax(ipaddress string) bool {
func isIPAddress(ipaddress string) bool {
addr := net.ParseIP(ipaddress)
if addr == nil {
return false
}
return true
return addr != nil
}
func resolveDNSHostname(hostname string) string {
@@ -53,7 +50,7 @@ func getIPInfo(ipaddress string) IPAddressInfo {
return info
}
func getBGPPrefixes(as string) {
func printBGPPrefixes(as string) {
apiEndpoint := "https://api.hackertarget.com/aslookup/?q=" + as
resp, err := http.Get(apiEndpoint)
if err != nil {