xhd2015/xgo

Discussion: not able to setup interceptor on inherited Method

Opened this issue · 0 comments

Given the following code:

type Base struct {
}

func (c Base) Validate(){}

type Sub struct {
    Base
}

Setting up interceptor Sub.Validate would fail with xgo 1.0.40:

func TestValidate(t *testing.T){
    trap.AddFuncInterceptor(Sub.Validate, ....)
}

The workaround:

func TestValidate(t *testing.T){
    trap.AddFuncInterceptor(Base.Validate, ....)
}