Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return ambiguous because of duplicate imports of unused package in sourceMode #226

Open
mmsqe opened this issue Dec 3, 2024 · 0 comments

Comments

@mmsqe
Copy link

mmsqe commented Dec 3, 2024

Actual behavior A clear and concise description of what the bug is.

mockgen imports another package github.com/cometbft/cometbft/rpc/jsonrpc/types with same name while source only imports github.com/cometbft/cometbft/types, and ambiguous error occurs:

"types" is ambiguous because of duplicate imports: [github.com/cometbft/cometbft/types github.com/cometbft/cometbft/rpc/jsonrpc/types]

Expected behavior A clear and concise description of what you expected to
happen.

No error when generate mock file.

To Reproduce Steps to reproduce the behavior

#!/usr/bin/env bash

for i in {1..10}; do
    mockgen -source=client/v2/broadcast/comet/comet.go -package testutil -destination client/v2/broadcast/comet/testutil/comet_mock.go
done

Additional Information

  • gomock mode (reflect or source): source
  • gomock version or git ref: v0.5.0
  • golang version: go1.23.3

Triage Notes for the Maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant