【问题标题】:go install revel cmd after dep ensure not work在 dep 确保不起作用后去安装 revel cmd
【发布时间】:2019-07-21 12:54:38
【问题描述】:

我想解决有关供应商的问题。 dep ensure 后,包安装在 vendor 文件夹下

但是 go install github.com/revel/cmd/revel 不像 revel 文档说的那样工作

当然,Gopkg.toml 包含它,并且包存在于 vendor 文件夹下。

我认为这与 GOPATH 有关。无法在 CLI 上搜索 vendor 下的包。

我该如何处理?

去安装github.com/revel/cmd/revel

错误信息:

can't load package: package github.com/revel/cmd/revel: cannot find package "github.com/revel/cmd/revel" in any of:
        C:\Go\src\github.com\revel\cmd\revel (from $GOROOT)
        C:\GoCode\src\github.com\revel\cmd\revel (from $GOPATH)

【问题讨论】:

    标签: revel


    【解决方案1】:

    确认安装的dep

    go get -u github.com/golang/dep/cmd/dep
    

    确保在你的 gopkg.toml 中你得到了

    require =[
            ...
            "github.com/revel/revel",
            ...
    ]
    

    然后

    GO111MODULE=off dep ensure
    GO111MODULE=off revel run
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-29
      • 1970-01-01
      • 1970-01-01
      • 2016-05-01
      • 2017-04-24
      • 1970-01-01
      • 2014-04-29
      相关资源
      最近更新 更多