zones: switch to using hackpadfs/os.FS as the standard os.FS is incomplete

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-23 19:14:56 +00:00
parent 75d7b4389a
commit 3c6dee543a
3 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -3,7 +3,8 @@ package zones
import (
"io/fs"
"os"
"github.com/hack-pad/hackpadfs/os"
"darvaza.org/resolver"
)
@@ -104,5 +105,10 @@ func NewFS(dir fs.FS, domain string) (*Zones, error) {
// New builds a [Zones] tree using the given directory
func New(dir, domain string) (*Zones, error) {
return NewFS(os.DirFS(dir), domain)
base, err := os.NewFS().Sub(dir)
if err != nil {
return nil, err
}
return NewFS(base, domain)
}