Update types.go

This commit is contained in:
Felix Lange 2025-08-07 14:10:50 +02:00 committed by GitHub
parent 0e1b7bd118
commit 1ea78b8937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -544,7 +544,7 @@ func parseBytes(encType interface{}) ([]byte, bool) {
// Handle array types. // Handle array types.
val := reflect.ValueOf(encType) val := reflect.ValueOf(encType)
if val.Kind() == reflect.Array && val.Type().Elem().Kind() == reflect.Uint8 { if val.Kind() == reflect.Array && val.Type().Elem().Kind() == reflect.Uint8 {
v := reflect.MakeSlice(reflect.TypeFor[[]byte](), val.Len(), val.Len()) v := reflect.ValueOf(make([]byte, val.Len()))
reflect.Copy(v, val) reflect.Copy(v, val)
return v.Bytes(), true return v.Bytes(), true
} }