Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed May 18, 2024
1 parent dad36f7 commit 47dcc4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [x] 支持对```CN2GT``````CN2GIA```线路的判断,原版[backtrace](https://github.com/zhanghanyun/backtrace)不支持
- [x] 支持对```CMIN2``````CMI```线路的判断,原版[backtrace](https://github.com/zhanghanyun/backtrace)不支持
- [x] 支持对整个回程路由进行线路分析,与原版[backtrace](https://github.com/zhanghanyun/backtrace)仅进行一次判断不同
- [x] 修复原版[backtrace](https://github.com/zhanghanyun/backtrace)对IPV4地址信息获取时json解析失败依然打印信息的问题
- [x] 修复原版[backtrace](https://github.com/zhanghanyun/backtrace)对IPV4地址信息获取时json解析失败依然打印信息的问题,本项目忽略错误继续执行路由线路查询
- [x] 增加对全平台的编译支持,原版[backtrace](https://github.com/zhanghanyun/backtrace)仅支持linux平台的amd64和arm64架构

## TODO
Expand Down
7 changes: 3 additions & 4 deletions backtrace/backtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package backtrace
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"

Expand Down Expand Up @@ -55,15 +54,15 @@ func BackTrace() {
}
rsp, err := http.Get("http://ipinfo.io")
if err != nil {
log.Fatalln("Get ip info err", err)
fmt.Errorf("Get ip info err %v \n", err.Error())
} else {
info := IpInfo{}
err = json.NewDecoder(rsp.Body).Decode(&info)
if err != nil {
log.Fatalln("json decode err", err)
fmt.Errorf("json decode err %v \n", err.Error())
} else {
fmt.Println(Green("国家: ") + White(info.Country) + Green(" 城市: ") + White(info.City) +
Green(" 服务商: ") + Blue(info.Org))
Green(" 服务商: ") + Blue(info.Org))
}
}
for i := range ips {
Expand Down

0 comments on commit 47dcc4c

Please sign in to comment.