Comment by connicpu

Comment by connicpu 2 days ago

0 replies

You do what the compiler has to do under the hood: at the top of the function create a list of open files, and have a defer statement that loops over the list closing all of the files. It's really not a complicated construct.