You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funccanCast[FROM, TOany](softbool) bool {
varfromFROManyFrom:=any(from)
ifanyFrom==nil { // check for interface by reflecttypeFrom:=reflect.TypeOf(&from).Elem()
typeTo:=reflect.TypeOf((*TO)(nil)).Elem()
toInterface:=typeTo.Kind() ==reflect.InterfacereturntoInterface&&typeFrom.Implements(typeTo) ||// interface -> not interface - maybe false positive when real FROM not TOsoft&&!toInterface&&typeTo.Implements(typeFrom)
}
_, ok:=anyFrom.(TO)
returnok
}
I suggest using something like:
instead simply:
For
As
just callcanCast[Initial, Alias]
do/di_alias.go
Lines 25 to 26 in 1998a7a
For
InvokeAs
apparently needgetInstanceType() reflect.Type
methoddo/service.go
Lines 131 to 133 in 1998a7a
The text was updated successfully, but these errors were encountered: