【问题标题】:how to run golang project downloaded from github如何运行从github下载的golang项目
【发布时间】:2019-07-26 19:02:18
【问题描述】:

我已经从 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)         

【问题讨论】:

  • 如果您不告诉我们错误是什么或向我们展示代码,就不可能告诉您如何修复错误。
  • @Flimzy 我已经编辑了这个问题。请检查
  • You Go 安装好像坏了。根据官方安装说明从官方源安装,并先测试您的安装。
  • @Volker 是的,我已经从官方来源安装了

标签: go github


【解决方案1】:

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

【讨论】:

  • 如果他们想修改代码也没用。
  • 是的,但问题中没有定义目的,所以只是为了以防万一它只是为了测试应用程序。
  • 具体说“我编辑代码运行的时候,出现很多错误”。
猜你喜欢
  • 2017-11-05
  • 1970-01-01
  • 2021-05-06
  • 2012-08-28
  • 1970-01-01
  • 1970-01-01
  • 2022-01-24
  • 1970-01-01
  • 2012-06-02
相关资源
最近更新 更多