I just slumped my shoulders as I realized that os.Stdout
is an os.File
. I want replace stdout with an in-memory buffer to avoid writing to a file. Is there any way to create a file that lives just in memory (and I don't want to deal with a ramdisk)?
Additional context: I'm dealing with calls to fmt.Println
. I don't have the option to use fmt.Fprintln
, which accepts an io.Writer
instead of going straight to os.Stdout
.