When running mockery, it will error out saying there's no module providing github.com/my/pkg/tools. However, Go itself has no issues importing the package.
Expected Behavior
Expected mockery to behave the same way as Go.
Actual Behavior
Mockery fails with:
07 Sep 24 19:07 EDT ERR encountered error when loading package error="-: no required module provides package github.com/my/pkg/tools; to add it:\n\tgo get github.com/my/pkg/tools" dry-run=false version=v2.45.0
Description
When referencing a Go module that is being replaced using the
replace
directive in thego.mod
file, mockery fails to load the package.Mockery Version
v2.45.0
Go Version
v1.23.0
Installation Method
Steps to Reproduce
Start with a
go.mod
that usesreplace
:And then attempt to generate mocks for interfaces in that package:
When running mockery, it will error out saying there's no module providing
github.com/my/pkg/tools
. However, Go itself has no issues importing the package.Expected Behavior
Expected mockery to behave the same way as Go.
Actual Behavior
Mockery fails with: