I got the following error today, but I was able to generate it successfully after deleting the existing mock file.
% mockgen -sourceγ./internal/app/usecase/xxx/repository.go -destination ./internal/app/usecase/xxx/repository_mock.go -package xxx
-: found packages xxx (repository.go) and mock_updateproteinevent (repository_mock.go) in /Users/xxx/go/src/proteinreminder/internal/app/usecase/xxx
2020/10/21 04:21:56 Loading input failed: loading package failed
# Delete
% rm -rf ./internal/app/usecase/xxx/repository_mock.go
# Run again and completed.
% mockgen -sourceγ./internal/app/usecase/xxx/repository.go -destination ./internal/app/usecase/xxx/repository_mock.go -package xxx
Top comments (2)
I'll keep an eye on this. I just started learning to work with mocks myself!
Serendipity! π