Skip to content

Commit

Permalink
use lookup for tag instead string comp
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi committed Mar 31, 2021
1 parent 568062d commit 8931b95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (c Container) Fill(structure interface{}) error {
for i := 0; i < s.NumField(); i++ {
f := s.Field(i)

if s.Type().Field(i).Tag == "container:\"inject\"" {
if t, ok := s.Type().Field(i).Tag.Lookup("container"); ok && t == "inject" {
if concrete, ok := c[f.Type()]; ok {
instance, err := concrete.resolve(c)
if err != nil {
Expand Down

0 comments on commit 8931b95

Please sign in to comment.