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
But if I disable the go compiler optimizations by passing -gcflags '-N' to the go run command, it succeeds:
go test -gcflags '-N' ./ -run ExampleGetFuncInfo
ok github.com/go-chai/chai 0.003s
I noticed that the line reported by GetFuncInfo is the line of the return rather than the line of the function signature. I suspect that it happens because of the function getting inlined or some other optimization that has to do with escape analysis, which in turn causes issues for the caller frames that GetFuncInfo relies on.
The text was updated successfully, but these errors were encountered:
https://github.com/go-chai/chai/blob/main/openapi2/funcinfo_test.go
This example fails if I run it normally via
go test ./ -run ExampleGetFuncInfo
But if I disable the go compiler optimizations by passing
-gcflags '-N'
to the go run command, it succeeds:go test -gcflags '-N' ./ -run ExampleGetFuncInfo
I noticed that the line reported by GetFuncInfo is the line of the return rather than the line of the function signature. I suspect that it happens because of the function getting inlined or some other optimization that has to do with escape analysis, which in turn causes issues for the caller frames that GetFuncInfo relies on.
The text was updated successfully, but these errors were encountered: