Skip to content

Commit 6ca9119

Browse files
authored
Refactor to use reflect.TypeAssert (#1621)
1 parent 7fbbe04 commit 6ca9119

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/collections/ordered_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func resolveKeyName(k reflect.Value) (string, error) {
243243
if k.Kind() == reflect.String {
244244
return k.String(), nil
245245
}
246-
if tm, ok := k.Interface().(encoding.TextMarshaler); ok {
246+
if tm, ok := reflect.TypeAssert[encoding.TextMarshaler](k); ok {
247247
if k.Kind() == reflect.Pointer && k.IsNil() {
248248
return "", nil
249249
}

0 commit comments

Comments
 (0)