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

gomock source parsing does not work correctly on locally defined types #53

Open
petergtz opened this issue Nov 17, 2017 · 0 comments
Open

Comments

@petergtz
Copy link
Owner

Given there is a

type CamelCaseType string

in display.go, then

cd generate_test_mocks/gomock_source/
ginkgo

will produce:

package matchers

import (
	"reflect"
	"github.com/petergtz/pegomock"
	 ""
)

func AnyCamelCaseType() CamelCaseType {
	pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(CamelCaseType))(nil)).Elem()))
	var nullValue CamelCaseType
	return nullValue
}

func EqCamelCaseType(value CamelCaseType) CamelCaseType {
	pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value})
	var nullValue CamelCaseType
	return nullValue
}

i.e. an empty import.

Maybe the GoMock source parsing should be abandoned any favor of the xtools method.

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