软件包github.com/matcornic/hermes/v2:在以下任意位置都找不到软件包“ github.com/matcornic/hermes/v2”:

时间:2018-12-20 16:26:22

标签: go

我想使用Golang电子邮件模板 当我运行

  

去-u github.com/matcornic/hermes/v2   它返回

     

包github.com/matcornic/hermes/v2:在以下任何位置都找不到包“ github.com/matcornic/hermes/v2”:           /usr/local/go/src/github.com/matcornic/hermes/v2(从$ GOROOT起)           /home/User/go/src/github.com/matcornic/hermes/v2(来自$ GOPATH)

我的go变量

GOPATH - /home/User/go
GOROOT - /usr/local/go
GOBIN - 

我整天都在处理这个错误,但是我找不到解决方法。请帮助我。

我多次将我的gopath设置到另一个目录,但是它不起作用

我正在此目录中编写代码

/home/User/go/src/Go-Web

在Go-Web中,我当前的项目位于

1 个答案:

答案 0 :(得分:1)

如自述文件所述:

  

从版本v2.0.0开始,Hermes使用Go模块。最新版本的Hermes需要启用gomodules的Go 1.11。您仍然可以通过使用v1.2.0版本来使用与先前Go版本兼容的Hermes版本

要么通过取消设置GOPATH来打开the module feature,要么使用软件包的版本1(github.com/matcornic/hermes,不带版本后缀)。