5 ms·
How does one go about implementing something like this? I am quite curious.
by avg_dev 3y ago
How does one go about implementing something like this? I am quite curious.
- yalue 3y agoJudging by the project, it's implemented by instrumenting the source code; either manually modifying error returns with a wrapper function, or by running source files through an automated tool that will find and modify the return statements for you.
- marhee 3y agoI suspect it is based on https://pkg.go.dev/runtime#Caller https://pkg.go.dev/runtime#Caller