Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
The Rust macro include_str includes a UTF-8 encoded file as a string; the Rust macro include_bytes includes a file as a reference to a byte array. Both of those 2 macros load files into the Rust binary at compile time and consume memory at run time. It might not be a good idea to use them for large files!
Embed File in Golang Binary
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
My understanding is that embeded files are loaded into memory, which means that the Go app might consume large memory if you embed a large file.
The "embed" package does not work with the Gophernotes kernel (for Jupyter/Lab notebooks).