S
@GudHelp
You can use this code
func getPublicIp() (string, error) {
resp, err := http.Get("https://myexternalip.com/raw")
if err != nil {
return "", err
}
content, _ := ioutil.ReadAll(resp.Body)
err = resp.Body.Close()
if err != nil {
return "", err
}
return string(content), nil
}