Rename squashfslow.Base to squashfslow.FileBase

This commit is contained in:
Caleb Gardner
2023-12-27 23:50:27 -06:00
parent bfba5d5b60
commit 144805e747
5 changed files with 63 additions and 28 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ import (
)
type Directory struct {
Base
FileBase
Entries []directory.Entry
}
@@ -49,15 +49,15 @@ func (r *Reader) directoryFromRef(ref uint64, name string) (*Directory, error) {
return nil, err
}
return &Directory{
Base: *r.BaseFromInode(i, name),
Entries: entries,
FileBase: *r.BaseFromInode(i, name),
Entries: entries,
}, nil
}
func (d *Directory) Open(r *Reader, path string) (*Base, error) {
func (d *Directory) Open(r *Reader, path string) (*FileBase, error) {
path = filepath.Clean(path)
if path == "." || path == "" {
return &d.Base, nil
return &d.FileBase, nil
}
split := strings.Split(path, "/")
i, found := slices.BinarySearchFunc(d.Entries, split[0], func(e directory.Entry, name string) int {