From 20f4e1f12de3ddca906265b05a98fb5be2cd2122 Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Tue, 2 Sep 2025 20:20:09 -0700 Subject: [PATCH] Use filepath.Path when handling directory names Signed-off-by: Evan Anderson --- pkg/action/install.go | 3 +-- pkg/cmd/template.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/action/install.go b/pkg/action/install.go index 0fe3ebc4b..79acc8c7d 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -26,7 +26,6 @@ import ( "log/slog" "net/url" "os" - "path" "path/filepath" "strings" "sync" @@ -677,7 +676,7 @@ func createOrOpenFile(filename string, appendData bool) (*os.File, error) { // check if the directory exists to create file. creates if doesn't exist func ensureDirectoryForFile(file string) error { - baseDir := path.Dir(file) + baseDir := filepath.Dir(file) _, err := os.Stat(baseDir) if err != nil && !errors.Is(err, fs.ErrNotExist) { return err diff --git a/pkg/cmd/template.go b/pkg/cmd/template.go index 81c112d51..59c24f39e 100644 --- a/pkg/cmd/template.go +++ b/pkg/cmd/template.go @@ -23,7 +23,6 @@ import ( "io" "io/fs" "os" - "path" "path/filepath" "regexp" "slices" @@ -250,7 +249,7 @@ func createOrOpenFile(filename string, appendData bool) (*os.File, error) { } func ensureDirectoryForFile(file string) error { - baseDir := path.Dir(file) + baseDir := filepath.Dir(file) _, err := os.Stat(baseDir) if err != nil && !errors.Is(err, fs.ErrNotExist) { return err