1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-28 07:17:06 +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

@@ -310,6 +310,11 @@ func PrefixDir(prefix string, fs http.FileSystem) http.FileSystem {
return &prefixedDir{prefix, fs}
}
// PrefixFS same as "PrefixDir" but for `fs.FS` type.
func PrefixFS(fileSystem fs.FS, dir string) (fs.FS, error) {
return fs.Sub(fileSystem, dir)
}
type prefixedDir struct {
prefix string
fs http.FileSystem