MCPcopy Create free account
hub / github.com/gogs/gogs / mustNames

Function mustNames

templates/embed.go:39–51  ·  view source on GitHub ↗
(fsys fs.FS)

Source from the content-addressed store, hash-verified

37}
38
39func mustNames(fsys fs.FS) []string {
40 var names []string
41 walkDirFunc := func(path string, d fs.DirEntry, err error) error {
42 if !d.IsDir() {
43 names = append(names, path)
44 }
45 return nil
46 }
47 if err := fs.WalkDir(fsys, ".", walkDirFunc); err != nil {
48 panic("assetNames failure: " + err.Error())
49 }
50 return names
51}
52
53// NewTemplateFileSystem returns a macaron.TemplateFileSystem instance for embedded assets.
54// The argument "dir" can be used to serve subset of embedded assets. Template file

Callers 1

NewTemplateFileSystemFunction · 0.85

Calls 2

appendFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected