From 6b8b690d4d0fcb9be82b6f40678b436827e51bab Mon Sep 17 00:00:00 2001 From: rocinantex Date: Sun, 22 Mar 2020 09:04:49 +0800 Subject: [PATCH] fix bug: abount dependency injection Former-commit-id: edf168d762602658ffb5d452f72048ada8b7156e --- hero/reflect.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hero/reflect.go b/hero/reflect.go index 655033b5..8b74f09b 100644 --- a/hero/reflect.go +++ b/hero/reflect.go @@ -142,7 +142,9 @@ func lookupFields(elem reflect.Value, skipUnexported bool, onlyZeros bool, paren index = append(parentIndex, i) } - field.Index = index + tmp := make([]int, len(index)) + copy(tmp, index) + field.Index = tmp fields = append(fields, field) }