xluohome / phonedata

手机号码归属地信息库、手机号归属地查询 phone.dat 最后更新:2023年02月
https://github.com/xluohome/phonedata
GNU General Public License v3.0
2.06k stars 381 forks source link

cmd目录下的phonedata.exe不能用 #6

Closed CNMan closed 7 years ago

CNMan commented 7 years ago
Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。

e:\Backup\go\src\github.com\xluohome\phonedata\cmd>go run phonedata.go 1388888
PhoneNum: 1388888
AreaZone: 0871
CardType: 中国移动
City: 昆明
ZipCode: 650000
Province: 云南

e:\Backup\go\src\github.com\xluohome\phonedata\cmd>phonedata 1388888
panic: open C:/Users/xluo/Documents/goproject/src/github.com/xluohome/phonedata/phone.dat: The system cannot find the path specified.

goroutine 1 [running]:
github.com/xluohome/phonedata.init.1()
        C:/Users/xluo/Documents/goproject/src/github.com/xluohome/phonedata/phonedata.go:58 +0x152
github.com/xluohome/phonedata.init()
        C:/Users/xluo/Documents/goproject/src/github.com/xluohome/phonedata/phonedata.go:185 +0x12e
main.init()
        C:/Users/xluo/Documents/goproject/src/github.com/xluohome/phonedata/cmd/phonedata.go:23 +0x55

e:\Backup\go\src\github.com\xluohome\phonedata\cmd>

依赖编译时phone.dat的路径,建议删除可执行文件,readme里添加编译说明。

xluohome commented 7 years ago

感谢,提交 issue。

phone.dat 的路径可以使用环境变量: PHONE_DATA_DIR 指定;

xluohome commented 7 years ago

README.md 已经修改示例描述文字。