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

继承的struct无法完成父struct的依赖注入 #167

Open
535727234 opened this issue Feb 7, 2023 · 0 comments
Open

继承的struct无法完成父struct的依赖注入 #167

535727234 opened this issue Feb 7, 2023 · 0 comments

Comments

@535727234
Copy link

535727234 commented Feb 7, 2023

以下代码GetApp2Singleton()后,访问父struct的ServiceImpl1会报空指针,错误panic: runtime error: invalid memory address or nil pointer dereference

// +ioc:autowire=true
// +ioc:autowire:type=singleton
type App struct {
ServiceImpl1 Service singleton:"main.ServiceImpl1"
ServiceImpl2 Service singleton:"main.ServiceImpl2"
}
// +ioc:autowire=true
// +ioc:autowire:type=singleton
type App2 struct {
App
ServiceStruct *ServiceStruct singleton:""
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant