0
votes

I want to use Golang email template and when I run

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)

My go Variables

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

I fight with this error the whole day, But I can't find out a solution. Please help me.

I set MY gopath to another directory several times but it does not work

I am writing code in this directory

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

and inside Go-Web my current project lies

1
It's because it doesn't exist. github.com/matcornic/hermes contains no subdirectory v2.Adrian

1 Answers

1
votes

As stated in the 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

Either turn on the module feature by unsetting GOPATH, or use version 1 of the package (github.com/matcornic/hermes, without the version suffix).