Closed Sovianum closed 2 years ago
Pegomock CLI generates invalid matchers when interface methods reference structures from the same package.
Library version: 2.9.0 Repro file:
//go:generate pegomock generate $GOFILE --output=${GOPACKAGE}mock/${GOFILE}_gen.go --package=${GOPACKAGE}mock --generate-matchers package issue type Arg struct{} type Provider interface { Get(a *Arg) }
One of invalid matchers:
package matchers import ( "github.com/petergtz/pegomock" "reflect" "" ) func AnyPtrToArg() *Arg { pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(*Arg))(nil)).Elem())) var nullValue *Arg return nullValue }
All structures from source package were imported with invalid import ""
""
Looks like consequence of https://github.com/petergtz/pegomock/issues/94
Duplicate https://github.com/petergtz/pegomock/issues/53
Pegomock CLI generates invalid matchers when interface methods reference structures from the same package.
Library version: 2.9.0 Repro file:
One of invalid matchers:
All structures from source package were imported with invalid import
""