File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"reflect"
6
6
"sort"
7
+ "strconv"
7
8
8
9
"github.com/kataras/iris/v12/context"
9
10
)
@@ -43,15 +44,14 @@ func newStructFieldInput(f reflect.StructField) *Input {
43
44
44
45
// String returns the string representation of a binding.
45
46
func (b * binding ) String () string {
46
- index := fmt . Sprintf ( "%d" , b . Input . Index )
47
+ var index string
47
48
if len (b .Input .StructFieldIndex ) > 0 {
48
- for j , i := range b .Input .StructFieldIndex {
49
- if j == 0 {
50
- index = fmt .Sprintf ("%d" , i )
51
- continue
52
- }
49
+ index = strconv .Itoa (b .Input .StructFieldIndex [0 ])
50
+ for _ , i := range b .Input .StructFieldIndex [1 :] {
53
51
index += fmt .Sprintf (".%d" , i )
54
52
}
53
+ } else {
54
+ index = strconv .Itoa (b .Input .Index )
55
55
}
56
56
57
57
return fmt .Sprintf ("[%s:%s] maps to [%s]" , index , b .Input .Type .String (), b .Dependency )
You can’t perform that action at this time.
0 commit comments