https://github.com/SleepingBag945/IPSearch
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH
export GOPROXY=https://proxy.golang.com.cn,direct
export CGO_ENABLED=1
export GOOS=windows
export GOARCH=amd64
gcc: error: unrecognized command line option ‘-mthreads’; did you mean ‘-pthread’?
apt-get install gcc-mingw-w64
apt-get install gcc-multilib
CC=x86_64-w64-mingw32-gcc
go build
queryInfoByIP
queryInfoByKey
query := "select inetnum,netname,country,descr,status,"last-modified" from ipseg where start <= %d and end >= %d order by end-start ASC limit 0,1;"
query = fmt.Sprintf(query, ip, ip)
rows, err := db.Query(query)
原文始发于微信公众号(here404):一款go语言的IP查询工具
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论