英文:
Installing a Go tool from github and facing installation errors
问题
我想安装这个来自GitHub的工具:https://github.com/ethicalhackingplayground/ssrf-tool
我正在使用以下命令:go install github.com/ethicalhackingplayground/ssrf-tool@latest
输出:
go: 找到 github.com/projectdiscovery/gologger 包的模块
go: 找到 github.com/briandowns/spinner 包的模块
go: 找到 github.com/logrusorgru/aurora 包的模块
go: 在 github.com/briandowns/spinner v1.18.1 中找到
go: 在 github.com/logrusorgru/aurora v2.0.3+incompatible 中找到
go: 在 github.com/projectdiscovery/gologger v1.1.4 中找到
# github.com/ethicalhackingplayground/ssrf-tool
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:34:2: 未定义:gologger.Printf
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:35:2: 未定义:gologger.Infof
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:36:2: 未定义:gologger.Infof
我对Go语言非常陌生,因为其他来自GitHub的工具都可以正常工作,所以我的系统中的Go安装是正常的。
如果需要对这个工具的代码进行一些更改,请提供建议。
英文:
I want to install this tool from github : https://github.com/ethicalhackingplayground/ssrf-tool
I am using the cmd :  go install github.com/ethicalhackingplayground/ssrf-tool@latest
Output :
go: finding module for package github.com/projectdiscovery/gologger
go: finding module for package github.com/briandowns/spinner
go: finding module for package github.com/logrusorgru/aurora
go: found github.com/briandowns/spinner in github.com/briandowns/spinner v1.18.1
go: found github.com/logrusorgru/aurora in github.com/logrusorgru/aurora v2.0.3+incompatible
go: found github.com/projectdiscovery/gologger in github.com/projectdiscovery/gologger v1.1.4
# github.com/ethicalhackingplayground/ssrf-tool
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:34:2: undefined: gologger.Printf
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:35:2: undefined: gologger.Infof
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool@v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:36:2: undefined: gologger.Infof
I am super new to golang, go installation is fine in my system because other tools from github are working fine.
If some changes are required in the code of this tool, please suggest so.
答案1
得分: 3
这个源码是没有使用Go模块支持和旧版本的gologger创建的,以下是解决方法:
- 克隆仓库 
git clone git@github.com:ethicalhackingplayground/ssrf-tool.git - 进入 
ssrf-tool目录,创建go.mod文件并添加以下内容: 
module github.com/ethicalhackingplayground/ssrf-tool
go 1.17
require (
	github.com/briandowns/spinner v1.18.1
	github.com/logrusorgru/aurora v2.0.3+incompatible
	github.com/projectdiscovery/gologger v1.0.1
)
require (
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/fatih/color v1.7.0 // indirect
	github.com/mattn/go-colorable v0.1.2 // indirect
	github.com/mattn/go-isatty v0.0.8 // indirect
	golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
)
- 下载依赖 
go mod download - 构建可执行文件 
go build . - 运行 
./ssrf-tool --help 
完成。
英文:
This sources created without go module support and an old version of gologger, here is a workaround:
- Clone repository 
git clone git@github.com:ethicalhackingplayground/ssrf-tool.git cd ssrf-toolcreatego.modfile with content:
module github.com/ethicalhackingplayground/ssrf-tool
go 1.17
require (
	github.com/briandowns/spinner v1.18.1
	github.com/logrusorgru/aurora v2.0.3+incompatible
	github.com/projectdiscovery/gologger v1.0.1
)
require (
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/fatih/color v1.7.0 // indirect
	github.com/mattn/go-colorable v0.1.2 // indirect
	github.com/mattn/go-isatty v0.0.8 // indirect
	golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
)
- download deps 
go mod download - Build executable 
go build . ./ssrf-tool --help
Profit.
答案2
得分: 1
这是修复了问题的仓库。
go install github.com/R0X4R/ssrf-tool@latest
或者
git clone https://github.com/R0X4R/ssrf-tool.git
cd ssrf-tool
go build ssrftool.go && mv ssrftool /usr/bin/
英文:
Here is the repo with the problem fixed.
go install github.com/R0X4R/ssrf-tool@latest
or
git clone https://github.com/R0X4R/ssrf-tool.git
cd ssrf-tool
go build ssrftool.go && mv ssrftool /usr/bin/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论