httpfs: Index | Files

package vfstemplate

import ""

Package vfstemplate offers html/template helpers that use http.FileSystem.


Package Files


func ParseFiles Uses

func ParseFiles(fs http.FileSystem, t *template.Template, filenames ...string) (*template.Template, error)

ParseFiles creates a new Template if t is nil and parses the template definitions from the named files. The returned template's name will have the (base) name and (parsed) contents of the first file. There must be at least one file. If an error occurs, parsing stops and the returned *Template is nil.

func ParseGlob Uses

func ParseGlob(fs http.FileSystem, t *template.Template, pattern string) (*template.Template, error)

ParseGlob parses the template definitions in the files identified by the pattern and associates the resulting templates with t. The pattern is processed by vfspath.Glob and must match at least one file. ParseGlob is equivalent to calling t.ParseFiles with the list of files matched by the pattern.

Package vfstemplate imports 6 packages (graph) and is imported by 23 packages. Updated 2019-04-18. Refresh now. Tools for package owners.