From 52d74936a30a43b1ee0dfea821e167339afac2ca Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Wed, 22 Jan 2025 20:02:06 -0300 Subject: [PATCH] docs(blogo,fs): documentation about FromIOFS and FromIOFile --- blogo/fs/iofs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blogo/fs/iofs.go b/blogo/fs/iofs.go index 9be0af4..e142c15 100644 --- a/blogo/fs/iofs.go +++ b/blogo/fs/iofs.go @@ -19,6 +19,8 @@ import ( iofs "io/fs" ) +// Wraps the provided [iofs.FS] file system so it can be used as a file system for blogo. +// [Metadata] from this [FS] will be empty, and by default, mutable. func FromIOFS(fsys iofs.FS, immutable ...bool) FS { if fsys == nil { return nil @@ -56,6 +58,8 @@ func (f *wrapperFS) Open(name string) (File, error) { return FromIOFile(file, f.immutable), nil } +// Wraps the provided [iofs.File] so it can be used as a file system for blogo. +// [Metadata] from this [File] will be empty, and by default, mutable. func FromIOFile(file iofs.File, immutable ...bool) File { m := MetadataMap(map[string]any{}) if len(immutable) > 0 && immutable[0] {