1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

minor (see prev commit)

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-09-26 00:34:18 +03:00
parent 512ed6ffc0
commit 68daa8d51d
10 changed files with 133 additions and 69 deletions

View File

@@ -222,6 +222,8 @@ func (s *DjangoEngine) RegisterTag(tagName string, fn TagParser) error {
//
// Returns an error if something bad happens, user is responsible to catch it.
func (s *DjangoEngine) Load() error {
rootDirName := getRootDirName(s.fs)
return walk(s.fs, "", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
@@ -237,6 +239,11 @@ func (s *DjangoEngine) Load() error {
}
}
if s.rootDir == rootDirName {
path = strings.TrimPrefix(path, rootDirName)
path = strings.TrimPrefix(path, "/")
}
contents, err := asset(s.fs, path)
if err != nil {
return err