aboutsummaryrefslogtreecommitdiffhomepage
path: root/vfs
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-30 18:15:56 +0900
committerOphestra <cat@gensokyo.uk>2026-03-30 18:24:53 +0900
commita6600be34ad812ff13c89f45c3cadaac6d994e67 (patch)
tree48c8cd6daab8084eb9391c7ee16f2b38f1cf280f /vfs
parentb5592633f5b980970808fc5be43b0fb4f4d4e784 (diff)
all: use filepath
This makes package check portable, and removes nonportable behaviour from package pkg, pipewire, and system. All other packages remain nonportable due to their nature. No latency increase was observed due to this change on amd64 and arm64 linux. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'vfs')
-rw-r--r--vfs/mountinfo_test.go4
-rw-r--r--vfs/unfold.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/vfs/mountinfo_test.go b/vfs/mountinfo_test.go
index 2b6254c4..e54890b2 100644
--- a/vfs/mountinfo_test.go
+++ b/vfs/mountinfo_test.go
@@ -5,7 +5,7 @@ import (
"errors"
"iter"
"os"
- "path"
+ "path/filepath"
"reflect"
"slices"
"strconv"
@@ -394,7 +394,7 @@ func mn(
},
FirstChild: firstChild,
NextSibling: nextSibling,
- Clean: path.Clean(target),
+ Clean: filepath.Clean(target),
Covered: covered,
}
}
diff --git a/vfs/unfold.go b/vfs/unfold.go
index 37c4cef3..57236ca4 100644
--- a/vfs/unfold.go
+++ b/vfs/unfold.go
@@ -2,7 +2,7 @@ package vfs
import (
"iter"
- "path"
+ "path/filepath"
"strings"
)
@@ -43,7 +43,7 @@ func (n *MountInfoNode) visit(yield func(*MountInfoNode) bool) bool {
// Unfold unfolds the mount hierarchy and resolves covered paths.
func (d *MountInfoDecoder) Unfold(target string) (*MountInfoNode, error) {
- targetClean := path.Clean(target)
+ targetClean := filepath.Clean(target)
var mountinfoSize int
for range d.Entries() {
@@ -61,7 +61,7 @@ func (d *MountInfoDecoder) Unfold(target string) (*MountInfoNode, error) {
{
i := 0
for ent := range d.Entries() {
- mountinfo[i] = &MountInfoNode{Clean: path.Clean(ent.Target), MountInfoEntry: ent}
+ mountinfo[i] = &MountInfoNode{Clean: filepath.Clean(ent.Target), MountInfoEntry: ent}
idIndex[ent.ID] = i
if mountinfo[i].Clean == targetClean {
targetIndex = i