v0.0.4 - 增加不显示IP信息的参数

This commit is contained in:
spiritlhl 2024-06-24 09:02:28 +00:00
parent 9c658fb118
commit 310b09e95b
3 changed files with 16 additions and 13 deletions

View File

@ -24,7 +24,7 @@ jobs:
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
TAG="v0.0.3-$(date +'%Y%m%d%H%M%S')"
TAG="v0.0.4-$(date +'%Y%m%d%H%M%S')"
git tag $TAG
git push origin $TAG
env:

View File

@ -1,4 +1,4 @@
package backtrace
const BackTraceVersion = "v0.0.3" // git tag v0.0.3
const BackTraceVersion = "v0.0.4" // git tag v0.0.4
var EnableLoger bool

View File

@ -23,14 +23,16 @@ func main() {
http.Get("https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fbacktrace&count_bg=%2323E01C&title_bg=%23555555&icon=sonarcloud.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false")
}()
fmt.Println(Green("项目地址:"), Yellow("https://github.com/oneclickvirt/backtrace"))
var showVersion bool
var showVersion, showIpInfo bool
flag.BoolVar(&showVersion, "v", false, "show version")
flag.BoolVar(&showIpInfo, "s", true, "diabel show ip info")
flag.BoolVar(&backtrace.EnableLoger, "e", false, "Enable logging")
flag.Parse()
if showVersion {
fmt.Println(backtrace.BackTraceVersion)
return
}
if showIpInfo {
rsp, err := http.Get("http://ipinfo.io")
if err != nil {
fmt.Errorf("Get ip info err %v \n", err.Error())
@ -44,6 +46,7 @@ func main() {
Green(" 服务商: ") + Blue(info.Org))
}
}
}
backtrace.BackTrace()
fmt.Println(Yellow("准确线路自行查看详细路由,本测试结果仅作参考"))
fmt.Println(Yellow("同一目标地址多个线路时,可能检测已越过汇聚层,除了第一个线路外,后续信息可能无效"))