qur / withmock

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

Missing argument in generated interface if there are more than one id in the same identifier list #29

Closed lunastorm closed 10 years ago

lunastorm commented 10 years ago

Consider this example:

type Adder interface {
    Add(x, y int) int 
}

The original interface after rewrite will become:

type Adder interface {
    Add(int) int 
}

which misses one int argument.

_ifmocks also applies:

func (_m *MockAdder) Add(p0 int) int {
    ret := _ctrl.Call(_m, "Add", p0) 
    ret0, _ := ret[0].(int)
    return ret0
}
func (_mr *_mock_Adder_rec) Add(p0 interface{}) *gomock.Call {
    return _ctrl.RecordCall(_mr.mock, "Add", p0) 
}

This works just fine:

Add(x int, y int) int
qur commented 10 years ago

Thanks.

A similar issue existed with return values - but that should also be fixed now.