Closed luisdavim closed 6 months ago
looks like I completely missed this: https://github.com/risor-io/risor/blob/main/os/in_memory_file.go (no clue how, I actually looked for it) 🤦 I'll update the PR to add some of the extra functionality from my version to the existing one.
@myzie I still don't know how I missed the pre-existing implementation and I'm kind of embarrassed by it but now that this is here, we have 3 options:
stdin
and stdout
use cases but writes are always append only and seek is not supported.I'm ok with any of the above options, please let me know what you think.
PS: I've updated the PR to rename the previous implementation to BufferFile
and added tests.
When embedding Risor into my project, I wanted to be able to capture the whole output of the script. For now I have a copy of this code in my project but this might be useful to others so I'm adding it here.