aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/path.go
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 /container/path.go
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 'container/path.go')
-rw-r--r--container/path.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/container/path.go b/container/path.go
index 5170fceb..5ae52dee 100644
--- a/container/path.go
+++ b/container/path.go
@@ -4,7 +4,7 @@ import (
"errors"
"io/fs"
"os"
- "path"
+ "path/filepath"
"strconv"
"strings"
"syscall"
@@ -29,16 +29,16 @@ const (
func toSysroot(name string) string {
name = strings.TrimLeftFunc(name, func(r rune) bool { return r == '/' })
- return path.Join(sysrootPath, name)
+ return filepath.Join(sysrootPath, name)
}
func toHost(name string) string {
name = strings.TrimLeftFunc(name, func(r rune) bool { return r == '/' })
- return path.Join(hostPath, name)
+ return filepath.Join(hostPath, name)
}
func createFile(name string, perm, pperm os.FileMode, content []byte) error {
- if err := os.MkdirAll(path.Dir(name), pperm); err != nil {
+ if err := os.MkdirAll(filepath.Dir(name), pperm); err != nil {
return err
}
f, err := os.OpenFile(name, syscall.O_CREAT|syscall.O_EXCL|syscall.O_WRONLY, perm)