gpt4 book ai didi

go - 包 github.com/matcornic/hermes/v2 : cannot find package "github.com/matcornic/hermes/v2" in any of:

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

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

go get -u github.com/matcornic/hermes/v2 it returns

package github.com/matcornic/hermes/v2: cannot find package "github.com/matcornic/hermes/v2" in any of: /usr/local/go/src/github.com/matcornic/hermes/v2 (from $GOROOT) /home/User/go/src/github.com/matcornic/hermes/v2 (from $GOPATH)

我的go变量

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

我整天都在和这个错误作斗争,但我找不到解决办法。请帮助我。

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

我在这个目录下写代码

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

在 Go-Web 里面是我当前的项目

最佳答案

如 README 中所述:

Starting from release v2.0.0, Hermes uses Go modules. The latest version of Hermes requires Go 1.11 with gomodules enabled. You can still use an Hermes release compatible with prior Go versions by using v1.2.0 release

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

关于go - 包 github.com/matcornic/hermes/v2 : cannot find package "github.com/matcornic/hermes/v2" in any of:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53872505/

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