I am implementing an API application in golang using gorilla/mux which is a powerfull library, tends to help to build web APIs,
However i need to keep ip address for each client for that how can i get ip address for each client who visits website?
Code:
func GetIpAddress(w http.ResponseWriter, r *http.Request){
// Whenever User visits this URL (this function)
// We have to know IP Address of user
output := r.UserAgent()
fmt.Print("Output : ", output)
// But var (output) returns whole string excluding clients ip address
}