gpt4 book ai didi

go - 如何运行从github下载的golang项目

转载 作者:数据小太阳 更新时间:2023-10-29 03:46:42 34 4
gpt4 key购买 nike

我已经从github下载了一个项目进行一些测试。代码是go语言。当我编辑代码并运行时,出现了很多错误。我尝试使用 D:\go>go run demo 命令运行项目。我应该如何运行该项目?

这里是错误:

D:\go>go run hardentools-master
bin\src\hardentools-master\powershell.go:20:2: cannot find package "errors" in any of:
D:\go\bin\src\errors (from $GOROOT)
C:\Users\admin\go\src\errors (from $GOPATH)
bin\src\hardentools-master\gui.go:20:2: cannot find package "flag" in any of:
D:\go\bin\src\flag (from $GOROOT)
C:\Users\admin\go\src\flag (from $GOPATH)
bin\src\hardentools-master\adobe.go:20:2: cannot find package "fmt" in any of:
D:\go\bin\src\fmt (from $GOROOT)
C:\Users\admin\go\src\fmt (from $GOPATH)
bin\src\hardentools-master\gui.go:26:2: cannot find package "github.com/lxn/walk" in any of:
D:\go\bin\src\github.com\lxn\walk (from $GOROOT)
C:\Users\admin\go\src\github.com\lxn\walk (from $GOPATH)
bin\src\hardentools-master\gui.go:27:2: cannot find package "github.com/lxn/walk/declarative" in any of:
D:\go\bin\src\github.com\lxn\walk\declarative (from $GOROOT)
C:\Users\admin\go\src\github.com\lxn\walk\declarative (from $GOPATH)
bin\src\hardentools-master\adobe.go:22:2: cannot find package "golang.org/x/sys/windows/registry" in any of:
D:\go\bin\src\golang.org\x\sys\windows\registry (from $GOROOT)
C:\Users\admin\go\src\golang.org\x\sys\windows\registry (from $GOPATH)
bin\src\hardentools-master\main.go:73:2: cannot find package "io" in any of:
D:\go\bin\src\io (from $GOROOT)
C:\Users\admin\go\src\io (from $GOPATH)
bin\src\hardentools-master\gui.go:22:2: cannot find package "io/ioutil" in any of:
D:\go\bin\src\io\ioutil (from $GOROOT)
C:\Users\admin\go\src\io\ioutil (from $GOPATH)
bin\src\hardentools-master\main.go:74:2: cannot find package "log" in any of:
D:\go\bin\src\log (from $GOROOT)
C:\Users\admin\go\src\log (from $GOPATH)
bin\src\hardentools-master\gui.go:23:2: cannot find package "os" in any of:
D:\go\bin\src\os (from $GOROOT)
C:\Users\admin\go\src\os (from $GOPATH)

最佳答案

您可以检查发布页面,您有一个可以使用的可执行文件:https://github.com/securitywithoutborders/hardentools/releases

关于go - 如何运行从github下载的golang项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55000653/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com