Or maybe I'm just doing something wrong.
I have a struct implementing generics where methods return the next method to execute.
For tests, I wanted to make sure the returned method was the one expected, so I was using this:
nextStageName := runtime.FuncForPC(reflect.ValueOf(nextStage).Pointer()).Name()
(where "nextStage" is the next method)
Here is a simple non-generic version where I get what I expect:
result: main.(*AStruct).NextStage-fm):
Here is probably a slightly convoluted generic version that does not:
result: main.(*GenericStruct[...]).Stage.func1
In that version, it seem to give me the name of the method that returned the next method.
Any idea what is (or what I'm doing) wrong?
Cheers.