In my function I get a a parameter. I need to convert this parameter. I want to convert this parameter to continue working with it
func IncWebhookRequestCount(obj something) {
a := obj.(*pkg.CustomType1)
a = obj.(*pkg.CustomType2)
}
I know that I am always able to convert it into CustomType1 or CustomType2. I do not care which one a is. How can I try converting into CustomType1 and if that does not work fall back to ?CustomType2.
Currently I get a panic: interface conversion