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

ResolveAll() panic deferencing a nil pointer #11

Open
drauschenbach opened this issue Jan 31, 2018 · 1 comment
Open

ResolveAll() panic deferencing a nil pointer #11

drauschenbach opened this issue Jan 31, 2018 · 1 comment

Comments

@drauschenbach
Copy link

drauschenbach commented Jan 31, 2018

I have an optional struct that I want to inject into another struct. So I define the reference as a pointer. ResolveAll() doesn't support this valid struct value and blows up trying to dereference it.

panic: no defined pointer is assignable to the provider argument 2 of type (*mypackage.MyStruct)

goroutine 1 [running]:
myorg/mypackage/myproject/vendor/github.com/karlkfi/inject.autoProvider.Provide(0x1ae7bc0, 0x1c82df8, 0x224d960, 0xc42000e798, 0x1c3cba0, 0xc420412501, 0xc4204142c0)
	/go/src/github.com/myorg/mypackage/myproject/vendor/github.com/karlkfi/inject/auto_provider.go:42 +0x41c
github.com/BixData/bixserver/vendor/github.com/karlkfi/inject.(*autoProvider).Provide(0xc420403990, 0x224d960, 0xc42000e798, 0x1acc6a0, 0xc4204125f0, 0x96)
	<autogenerated>:1 +0x59
myorg/mypackage/myproject/vendor/github.com/karlkfi/inject.(*definition).Resolve(0xc420412090, 0x224d960, 0xc42000e798, 0x1b15860, 0xc4204125f0, 0x96)
	/go/src/github.com/myorg/mypackage/myproject/vendor/github.com/karlkfi/inject/definition.go:48 +0x81
myorg/mypackage/myproject/vendor/github.com/karlkfi/inject.(*graph).ResolveAll(0xc42000e798, 0xb, 0x2296901, 0x22477c0)
	/go/src/github.com/myorg/mypackage/myproject/vendor/github.com/karlkfi/inject/graph.go:91 +0xf9
main.main()
@karlkfi
Copy link
Owner

karlkfi commented Jan 31, 2018

Can you provide a minimal example to reproduce the problem?

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

2 participants