Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: not able to setup interceptor on inherited Method #209

Open
xhd2015 opened this issue Jun 20, 2024 · 0 comments
Open

Discussion: not able to setup interceptor on inherited Method #209

xhd2015 opened this issue Jun 20, 2024 · 0 comments
Labels

Comments

@xhd2015
Copy link
Owner

xhd2015 commented Jun 20, 2024

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, ....)
}
@xhd2015 xhd2015 added the mock label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant