mirror of
https://github.com/safing/portbase
synced 2025-09-15 09:39:50 +00:00
Fix tests and linter warnings
This commit is contained in:
parent
7d2cd6c15d
commit
f59ad0357a
162 changed files with 668 additions and 696 deletions
|
@ -41,15 +41,15 @@ func (ds *DirStructure) ChildDir(dirName string, perm os.FileMode) (child *DirSt
|
|||
}
|
||||
|
||||
// create new
|
||||
new := &DirStructure{
|
||||
newDir := &DirStructure{
|
||||
Path: filepath.Join(ds.Path, dirName),
|
||||
Dir: dirName,
|
||||
Perm: perm,
|
||||
Parent: ds,
|
||||
Children: make(map[string]*DirStructure),
|
||||
}
|
||||
ds.Children[dirName] = new
|
||||
return new
|
||||
ds.Children[dirName] = newDir
|
||||
return newDir
|
||||
}
|
||||
|
||||
// Ensure ensures that the specified directory structure (from the first parent on) exists.
|
||||
|
@ -94,7 +94,7 @@ func (ds *DirStructure) EnsureAbsPath(dirPath string) error {
|
|||
// get relative path
|
||||
relPath, err := filepath.Rel(ds.Path, dirPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get relative path: %s", err)
|
||||
return fmt.Errorf("failed to get relative path: %w", err)
|
||||
}
|
||||
|
||||
// split to path elements
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue