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

Generate private interface doesn't work #376

Open
ijalalfrz opened this issue Mar 23, 2021 · 3 comments
Open

Generate private interface doesn't work #376

ijalalfrz opened this issue Mar 23, 2021 · 3 comments

Comments

@ijalalfrz
Copy link

i'm using mockery version 2.7.4, and i have a private interface:

type elasticsearchRequest interface {
	Do(ctx context.Context, transport esapi.Transport) (resp *esapi.Response, err error)
}

what i did : mockery --exported --name=elasticsearchRequest
generated file still use private interface

// Code generated by mockery v2.7.4. DO NOT EDIT.

package mocks

import (
	context "context"

	esapi "github.com/elastic/go-elasticsearch/v7/esapi"
	mock "github.com/stretchr/testify/mock"
)

// elasticsearchRequest is an autogenerated mock type for the elasticsearchRequest type
type elasticsearchRequest struct {
	mock.Mock
}
...
@built-by-as
Copy link

built-by-as commented Mar 23, 2021

I am experiencing this as well

Edit: found the root cause, it's because of this:

if !g.KeepTree && g.InPackage {

Using the --in-package flag with --exported works. Seems like a bug

@guzmonne
Copy link

guzmonne commented May 7, 2021

Bump

@LandonTClipp
Copy link
Contributor

I hope that this issue will be resolved by the granular level of control the packages configuration feature gives you. Please give that a shot and let me know if it doesn't work.

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

4 participants