Thanks, Ian. That was an interesting thread -- yes, complicated! However, it seems that at least Create() was suggested several times with the same basic shape, so I guess I'm aiming in the right direction. My Append() seems to be novel, but I think "fits". It avoids the interface having to think about OS-level mode/perm/flags.
On Tue, 28 Jul 2026 at 17:31, Ian Lance Taylor <[email protected]> wrote: > On Mon, Jul 27, 2026 at 8:15 PM [email protected] <[email protected]> > wrote: > > > > I'd like it to be shaped like io/fs.FS. However, that only supports > read-only files (Open returns an fs.File). So my thought is to have an > interface extension like so: > > > > type WriteFS interface { > > fs.FS > > Create(name string) (io.WriteCloser, error) > > Append(name string) (io.WriteCloser, error) > > } > > There is some previous discussion at https://go.dev/issue/45757. > > TL;DR: It's complicated. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAL9jXCH3%3DREus%3DYZeO53zuMsTekdstX5MKCrva_eK7nWnemA7g%40mail.gmail.com.
