Open joesustaric opened 8 years ago
To reproduce this try the following.
File Testpack\testpack.go:
package testpack type TPStruct struct {} //func (t TPStruct) Method() {} //Uncomment this line to produce error func (t *TPStruct) PointerMethod()
file wmscratch\wmscratch.go:
package wmscratch import "testpack" func PointerFunction(t *testpack.TPStruct) { t.PointerMethod() }
Test file Wmscratch\wmscratch_test.go:
package wmscratch import ( "testing" "testpack" //mock "github.com/golang/mock/gomock" ) func TestSumSqrt(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() testpack.MOCK().SetController(ctrl) tp := testpack.TPStruct{} tp_ptr := &tp tp_ptr.EXPECT().PointerMethod() PointerFunction(tp_ptr) }
Uncommenting the func (t TPStruct) Method() {} in the TPStruct package:
func (t TPStruct) Method() {}
controller.go:113: no matching expected call: *testpack.TPStruct.PointerMethod([]) controller.go:158: missing call(s) to testpack.TPStruct.PointerMethod()
To reproduce this try the following.
File Testpack\testpack.go:
file wmscratch\wmscratch.go:
Test file Wmscratch\wmscratch_test.go:
Uncommenting the
func (t TPStruct) Method() {}
in the TPStruct package: