Skip to content

Commit f19da31

Browse files
authored
Merge pull request #1475 from rocinantex/v12
fix bug: abount dependency injection Former-commit-id: d163c85d43e6e1db3f7858eefd6b6c654cb541c6
2 parents 08403f0 + 28bb5c5 commit f19da31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hero/di/reflect.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,13 @@ func lookupFields(elemTyp reflect.Type, skipUnexported bool, parentIndex []int)
229229
index = append(parentIndex, i)
230230
}
231231

232+
tmp := make([]int, len(index))
233+
copy(tmp, index)
234+
232235
field := field{
233236
Type: f.Type,
234237
Name: f.Name,
235-
Index: index,
238+
Index: tmp,
236239
CanSet: isExported,
237240
}
238241

0 commit comments

Comments
 (0)