I'm faced with a little challenge today. I'm using a library which ultimately uses sycalls to do the stuff. If a syscall fails, it returns with an error obtained from the syscall itself. As these errors come from the native apis (like winapi?), they are sometimes generic (like system cannot find path specified). If they are from go code/library code itself I can just do a find on the files of interest. But how can I know exactly which line returned in the call stack with that error without some kind of mechanism. runtime.Stack() is not an option since we are talking about the existing library code. Any ideas?
有疑问加站长微信联系(非本文作者)