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

add support for embed.FS

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-09-19 01:15:38 +03:00
parent 71e8a14615
commit 414c1ad1ae
15 changed files with 179 additions and 22 deletions

View File

@@ -40,9 +40,7 @@ func (r resource) strip(strip string) string {
}
func (r resource) loadFromBase(dir string) string {
filename := r.String()
filename = r.strip("/static")
filename := r.strip("/static")
fullpath := filepath.Join(dir, filename)
@@ -52,11 +50,6 @@ func (r resource) loadFromBase(dir string) string {
}
result := string(b)
if runtime.GOOS != "windows" {
result = strings.ReplaceAll(result, "\n", "\r\n")
result = strings.ReplaceAll(result, "\r\r", "")
}
return result
}