oops icon indicating copy to clipboard operation
oops copied to clipboard

Embed sources at compile time

Open samber opened this issue 1 year ago • 3 comments

It would be helpful to embed source code in binary, since the .Sources() getter read the sources at runtime, at location specified in the stack trace.

I don't see any developer-friendly way to do it, except by using an extra compilation step or codegen. 🙄

The best scenario would be to enable/disable it with a flag in the compilation line or with an environment variable.

Example:

OOPS_EMBED_SOURCES="none" // default
OOPS_EMBED_SOURCES="minimal"   // project
OOPS_EMBED_SOURCES="all"  // project + dependencies (very heavy!!)

Any idea ?

samber avatar May 18 '23 16:05 samber