Skip to content

Commit 9873aac

Browse files
committed
update
1 parent 6accab4 commit 9873aac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libs/structs/structdiff/diff.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ func keyFuncFor(node *structtrie.Node) KeyFunc {
6363
return nil
6464
}
6565
if value := node.Value(); value != nil {
66-
return value.(*keyFuncCaller)
66+
if fn, ok := value.(KeyFunc); ok {
67+
return fn
68+
}
6769
}
6870
return nil
6971
}
@@ -77,11 +79,11 @@ func BuildSliceKeyTrie(sliceKeys map[string]KeyFunc) (*structtrie.Node, error) {
7779

7880
root := structtrie.New()
7981
for pattern, fn := range sliceKeys {
80-
caller, err := newKeyFuncCaller(fn)
82+
_, err := newKeyFuncCaller(fn)
8183
if err != nil {
8284
return nil, err
8385
}
84-
if _, err := structtrie.InsertString(root, pattern, caller); err != nil {
86+
if _, err := structtrie.InsertString(root, pattern, fn); err != nil {
8587
return nil, err
8688
}
8789
}

0 commit comments

Comments
 (0)