Skip to content

Should not resolve type alias when generate mock files #216

@lance6716

Description

@lance6716

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

we have an interface that uses "github.com/tikv/client-go/v2/tikv".Codec. And that type is defined as

under "github.com/tikv/client-go/v2/tikv":

import "github.com/tikv/client-go/v2/internal/apicodec"
...
type Codec = apicodec.Codec

In the generated mock files, it directly imports "github.com/tikv/client-go/v2/internal/apicodec" which is not allowed for the non-internal usage.

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

It should import "github.com/tikv/client-go/v2/tikv" instead

To Reproduce Steps to reproduce the behavior

  1. ...
  2. ...

Additional Information

  • gomock mode (reflect or source): default value
  • gomock version or git ref: v0.5.0
  • golang version: 1.23

Triage Notes for the Maintainers

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions