Skip to content

Commit 35ef918

Browse files
committed
docs: enhance documentation and update testing configurations
- Improve the documentation for the `AddFromFS` function, providing detailed descriptions for parameters and return values. Signed-off-by: appleboy <[email protected]>
1 parent c70d254 commit 35ef918

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dynamic.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,16 @@ func (r DynamicRender) AddFromGlob(name, glob string) *template.Template {
116116
return builder.buildTemplate()
117117
}
118118

119-
// AddFromFS supply add template from fs.FS (e.g. embed.FS)
119+
// AddFromFS adds a new template to the DynamicRender from the provided file system (fs.FS) and files.
120+
// It allows you to specify a custom function map (funcMap) to be used within the template.
121+
// The name parameter is used to associate the template with a key in the DynamicRender.
122+
// The files parameter is a variadic list of file paths to be included in the template.
123+
// - name: The name to associate with the template in the DynamicRender.
124+
// - fsys: The file system (fs.FS) from which to read the template files.
125+
// - files: A variadic list of file paths to be included in the template.
126+
//
127+
// Returns:
128+
// - *template.Template: The constructed template.
120129
func (r DynamicRender) AddFromFS(name string, fsys fs.FS, files ...string) *template.Template {
121130
builder := &templateBuilder{templateName: name, fsys: fsys, files: files}
122131
builder.buildType = fsTemplateType

0 commit comments

Comments
 (0)