I have a variable which value is a function and I'd like to know what are the parameters of that function, specifically the types of the parameters and the type of returned value. Can I retrieve that information in Go?
In Python I can use inspect.signature function to get information about a function - its parameters and the types of parameters of that functions and also the type of the returned value.
For example in Python I can do:
from inspect import signature
def a(b: int) -> str:
return "text"
sig = signature(a) // contains information about parameters and returned value
How to do this in Go?