Skip to content

ResolveAll() panic deferencing a nil pointer #11

Description

@drauschenbach

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions