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

Flag for interface exclusion #68

Closed
tulzke opened this issue Aug 25, 2023 · 0 comments
Closed

Flag for interface exclusion #68

tulzke opened this issue Aug 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tulzke
Copy link
Contributor

tulzke commented Aug 25, 2023

Please add the ability to exclude interfaces, if source mode of mockgen is used.

This can be useful in the following case:

package segmentation

//go:generate mockgen -destination=segmenter_mock.go -package=segmentation -source=segmenter.go

// need to exlude this interface, because it is constraint
type Segment interface {
	~int
}

type Segmenter[V Segment] interface {
	Segment(code string) V
}

You can do this by passing a flag or using a comment like // gomock:exclude

@r-hang r-hang added the enhancement New feature or request label Sep 6, 2023
tulzke added a commit to tulzke/mock that referenced this issue Sep 7, 2023
r-hang pushed a commit that referenced this issue Sep 15, 2023
The problem is described in the issue. This is one of the solutions to
this problem.
@tulzke tulzke closed this as completed Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants