Answer the question
In order to leave comments, you need to log in
How to find out in golang what ip/country/city the user came from?
How to find out in golang what ip/country/city the user came from?
Answer the question
In order to leave comments, you need to log in
Golang has nothing to do with
getting IP - you go to the databases
https://sypexgeo.net/
tabgeo.com/en/index
IP is in http.Request.RemoteAddr
which is transmitted to anyonehttp.Handler
http.HandleFunc("/something", func(w http.ResponseWriter, r *http.Request) {
IP := r.RemoteAddr()
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question