qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

Generated Mock package is missing anonymous field #14

Closed imosquera closed 10 years ago

imosquera commented 10 years ago

When I use mocktest the generated struct is missing an inner field causing some structs to no longer satisfy their interfaces.

for instance

type Bar struct { }

func(b Bar)MyMethod() {}

type Foo struct { Bar }

type Barer interface{ MyMethod() }

when the struct code is generated it's missing Bar such that it looks like the following:

type Foo struct { Bar }

imosquera commented 10 years ago

I just realized this actually doesn't matter now that I have the "-exclude" flag so I can use mockgen to generate mocks again and use mocktest together again. I'll go ahead and close this one.