codegangsta / inject

Dependency injection for go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

about injector Get method

lmliang opened this issue · comments

injector using a map stored values, use type in the Get method to obtain value. If there is more value will be lost if the same type value, for example there are two Int64 value. I was a novice, I'm not sure.

you need to create a new type for the second int64, for example:

dep := "some dependency"
injector.Map(dep)
dep2 := "another dep"
injector.MapTo(dep2, (*SpecialString)(nil))