golib icon indicating copy to clipboard operation
golib copied to clipboard

memfile: add empty Close function

Open jozo opened this issue 5 years ago • 3 comments

Sometimes it's useful to have also Close() function in memfile. I needed it when I worked with https://github.com/faiface/beep

Just something simple like this:

func (fb *File) Close() error { return nil }

Can you please add it?

jozo avatar Dec 01 '20 16:12 jozo

Pull requests welcomed. However, Close should not simply be a noop. It should forbid subsequent IO operations in a similar way to how os.File.Close disallows subsequent IO operations.

dsnet avatar Dec 01 '20 23:12 dsnet

Ha, I needed that as well today. Decided to not use memfile and build my own because of not having the close method

MariusVanDerWijden avatar Oct 24 '23 07:10 MariusVanDerWijden

Implemented it now https://github.com/dsnet/golib/pull/5

MariusVanDerWijden avatar Oct 24 '23 07:10 MariusVanDerWijden