chore(AnyObjectHolder): Inline cast check

This commit is contained in:
Daniel López Guimaraes 2025-01-11 22:37:00 +00:00
parent 340b851e5f
commit 9c8f7bd62e
No known key found for this signature in database
GPG key ID: 6AC74DE3DEF050E0

View file

@ -74,8 +74,7 @@ func (aoh *AnyObjectHolder[T]) ExtractFrom(readable Readable) error {
}
var ok bool
aoh.Object, ok = ptr.Deref().(T)
if (!ok) {
if aoh.Object, ok = ptr.Deref().(T); !ok {
return fmt.Errorf("Input AnyObjectHolder object %s is invalid", identifier)
}