I had a rapid look over you code. There might be a problem with geoip.go. As regards the NewGeoIP, it’s deceptive. It says if you want a new GeoIP call me. But in fact it overrides the singleton instance of gip. Why did you do it this way ? Would it be inappropriate to provide a new one at each call ? Of course if you change from singleton to prototype creation, the CloseGeoIPHandle should be a struct function. Hope it could help.