diff options
| -rw-r--r-- | ssh/messages.go | 2 | ||||
| -rw-r--r-- | ssh/messages_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ssh/messages.go b/ssh/messages.go index 251b9d0..ab22c3d 100644 --- a/ssh/messages.go +++ b/ssh/messages.go @@ -792,7 +792,7 @@ func marshalString(to []byte, s []byte) []byte { return to[len(s):] } -var bigIntType = reflect.TypeOf((*big.Int)(nil)) +var bigIntType = reflect.TypeFor[*big.Int]() // Decode a packet into its corresponding message. func decode(packet []byte) (interface{}, error) { diff --git a/ssh/messages_test.go b/ssh/messages_test.go index d8691bd..ed34628 100644 --- a/ssh/messages_test.go +++ b/ssh/messages_test.go @@ -257,7 +257,7 @@ func TestDecode(t *testing.T) { userAuthSuccess, err := decode([]byte{msgUserAuthSuccess}) if err != nil { t.Errorf("error decoding userAuthSuccessMsg") - } else if reflect.TypeOf(userAuthSuccess) != reflect.TypeOf((*userAuthSuccessMsg)(nil)) { + } else if _, ok := userAuthSuccess.(*userAuthSuccessMsg); !ok { t.Errorf("error decoding userAuthSuccessMsg, unexpected %T", userAuthSuccess) } } |
