README ¶ 命令行 go get github.com/techxmind/location2ip/cmd/loc2ip loc2ip -h loc2ip -n 5 北京 示例 import ( "fmt" "github.com/techxmind/location2ip" ) var locs = []string{ "成都", "四川", "156007000004", // 位置编码:www.ipcaa.org } for loc := range locs { if ip, err = location2ip.Generate(loc); err == nil { fmt.Println("ip: %s", ip) } } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Variables func Generate(geo string) (ip string, err error) Constants ¶ This section is empty. Variables ¶ View Source var ErrInvalidGeo = errors.New("Invalid geo") Functions ¶ func Generate ¶ func Generate(geo string) (ip string, err error) Types ¶ This section is empty. Source Files ¶ View all Source files data_202009.golocation2ip.go Directories ¶ Show internal Expand all Path Synopsis cmd loc2ip command Click to show internal directories. Click to hide internal directories.