diff --git a/printer/printer.go b/printer/printer.go index 7fe30cf..2474027 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -52,11 +52,11 @@ func formatIpGeoData(ip string, data *ipgeo.IPGeoData) string { // TODO: 判断阿里云和腾讯云内网,数据不足,有待进一步完善 // TODO: 移动IDC判断到Hop.fetchIPData函数,减少API调用 if strings.HasPrefix(ip, "9.") { - res = append(res, "局域网", "腾讯云") + res = append(res, "LAN Address", "") } else if strings.HasPrefix(ip, "11.") { - res = append(res, "局域网", "阿里云") + res = append(res, "LAN Address", "") } else if data.Country == "" { - res = append(res, "局域网") + res = append(res, "LAN Address") } else { // 有些IP的归属信息为空,这个时候将ISP的信息填入 if data.Owner == "" { diff --git a/printer/tableprinter.go b/printer/tableprinter.go index 46c748b..7708b02 100644 --- a/printer/tableprinter.go +++ b/printer/tableprinter.go @@ -2,9 +2,10 @@ package printer import ( "fmt" - "github.com/xgadget-lab/nexttrace/ipgeo" "strings" + "github.com/xgadget-lab/nexttrace/ipgeo" + "github.com/xgadget-lab/nexttrace/trace" "github.com/fatih/color" @@ -73,16 +74,16 @@ func tableDataGenerator(h trace.Hop) *rowData { Hop: fmt.Sprint(h.TTL), IP: IP, Latency: lantency, - Country: "局域网", - Owner: "腾讯云", + Country: "LAN Address", + Owner: "", } } else if strings.HasPrefix(IP, "11.") { return &rowData{ Hop: fmt.Sprint(h.TTL), IP: IP, Latency: lantency, - Country: "局域网", - Owner: "阿里云", + Country: "LAN Address", + Owner: "", } } diff --git a/trace/temp_printer.go b/trace/temp_printer.go index d067adf..752b350 100644 --- a/trace/temp_printer.go +++ b/trace/temp_printer.go @@ -39,11 +39,11 @@ func formatIpGeoData(ip string, data *ipgeo.IPGeoData) string { // TODO: 判断阿里云和腾讯云内网,数据不足,有待进一步完善 // TODO: 移动IDC判断到Hop.fetchIPData函数,减少API调用 if strings.HasPrefix(ip, "9.") { - res = append(res, "局域网", "腾讯云") + res = append(res, "LAN Address", "") } else if strings.HasPrefix(ip, "11.") { - res = append(res, "局域网", "阿里云") + res = append(res, "LAN Address", "") } else if data.Country == "" { - res = append(res, "局域网") + res = append(res, "LAN Address") } else { // 有些IP的归属信息为空,这个时候将ISP的信息填入 if data.Owner == "" {