An IP-Location Parser Written in GO

Datetime:2016-08-23 05:16:17         Topic: Golang          Share        Original >>
Here to See The Original Article!!!

This parser is targeted to parse a IP dataset, which contains the data mapping like this:

type Information struct {
Continent string
Country string
Province string
City string
Isp string
CountryEn string
CountryCode string
long string
lat string

Note, data sample is not included in this repo, you can get it from QQZENG, or you can drop me an email and get a short sample.

This parser is under MIT license .


go test
go test -bench=Search


Get the parser

go get


import (

func main() {
ip := ""
data := "datafile.dat"

if parser, err := QQLocation.Init(data); err != nil {
if info, errParse := parser.Search(ip); errParse != nil {


Put your ads here, just $200 per month.