refactor to use reflect.TypeFor (#15627)

* refactor to use reflect.TypeFor

* added changelog fragment file

* update changelog

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Sahil Sojitra
2025-09-26 22:56:44 +05:30
committed by GitHub
parent 29fe707143
commit 0ea5e2cf9d
2 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
### Changed
- Replaced reflect.TypeOf with reflect.TypeFor

View File

@@ -320,6 +320,6 @@ func IsProto(item interface{}) bool {
return ok
}
elemTyp := typ.Elem()
modelType := reflect.TypeOf((*proto.Message)(nil)).Elem()
modelType := reflect.TypeFor[proto.Message]()
return elemTyp.Implements(modelType)
}