Search code examples
gogo-modules

How to fix gomod: `github.com/stretchrcom/[email protected]: parsing go.mod: unexpected module path "github.com/stretchr/testify"`


When I do a go mod tidy. I got the following error:

go: github.com/stretchrcom/[email protected]: parsing go.mod: unexpected module path "github.com/stretchr/testify"

Solution

  • This error is due a package referring to testify before it was moved to github.com/stretchr/testify.

    The solution is to add the following line in your go.mod:

    replace github.com/stretchrcom/testify v1.4.0 => github.com/stretchr/testify v1.4.0