From 6a701dd3114a53ac45e6b716d814719150fad0a6 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 26 Apr 2026 22:50:32 +0300 Subject: [PATCH] Switch from path to filepath package --- src/config.go | 10 +++++----- src/keybindings.go | 10 +++++----- src/style.go | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/config.go b/src/config.go index 6cc9252..2b37a62 100644 --- a/src/config.go +++ b/src/config.go @@ -3,7 +3,7 @@ package main import ( "log" "os" - "path" + "path/filepath" "runtime" "gopkg.in/yaml.v3" @@ -44,11 +44,11 @@ func readConfig() { configPaths := make([]string, 0) if runtime.GOOS == "windows" { - configPaths = append(configPaths, path.Join(homeDir, "AppData/Roaming/Typer/config.yml")) - configPaths = append(configPaths, path.Join(path.Dir(execPath), "etc/typer/config.yml")) + configPaths = append(configPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/config.yml")) + configPaths = append(configPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/config.yml")) } else { - configPaths = append(configPaths, path.Join(homeDir, ".config/typer/config.yml")) - configPaths = append(configPaths, path.Join(sysconfdir, "typer/config.yml")) + configPaths = append(configPaths, filepath.Join(homeDir, ".config/typer/config.yml")) + configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/config.yml")) } for _, configPath := range configPaths { diff --git a/src/keybindings.go b/src/keybindings.go index 8653d00..63bc8c9 100644 --- a/src/keybindings.go +++ b/src/keybindings.go @@ -3,7 +3,7 @@ package main import ( "log" "os" - "path" + "path/filepath" "runtime" "strings" @@ -40,11 +40,11 @@ func readKeybindings() { configPaths := make([]string, 0) if runtime.GOOS == "windows" { - configPaths = append(configPaths, path.Join(homeDir, "AppData/Roaming/Typer/keybindings.yml")) - configPaths = append(configPaths, path.Join(path.Dir(execPath), "etc/typer/keybindings.yml")) + configPaths = append(configPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/keybindings.yml")) + configPaths = append(configPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/keybindings.yml")) } else { - configPaths = append(configPaths, path.Join(homeDir, ".config/typer/keybindings.yml")) - configPaths = append(configPaths, path.Join(sysconfdir, "typer/keybindings.yml")) + configPaths = append(configPaths, filepath.Join(homeDir, ".config/typer/keybindings.yml")) + configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/keybindings.yml")) } for _, configPath := range configPaths { diff --git a/src/style.go b/src/style.go index f5d4179..df15c11 100644 --- a/src/style.go +++ b/src/style.go @@ -4,7 +4,7 @@ import ( "fmt" "log" "os" - "path" + "path/filepath" "reflect" "runtime" "slices" @@ -85,11 +85,11 @@ func readStyles() { stylesPaths := make([]string, 0) if runtime.GOOS == "windows" { - stylesPaths = append(stylesPaths, path.Join(homeDir, "AppData/Roaming/Typer/styles")) - stylesPaths = append(stylesPaths, path.Join(path.Dir(execPath), "etc/typer/styles")) + stylesPaths = append(stylesPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/styles")) + stylesPaths = append(stylesPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/styles")) } else { - stylesPaths = append(stylesPaths, path.Join(homeDir, ".config/typer/styles")) - stylesPaths = append(stylesPaths, path.Join(sysconfdir, "typer/styles")) + stylesPaths = append(stylesPaths, filepath.Join(homeDir, ".config/typer/styles")) + stylesPaths = append(stylesPaths, filepath.Join(sysconfdir, "typer/styles")) } for _, stylesPath := range stylesPaths { @@ -107,7 +107,7 @@ func readStyles() { // Read entries in directory for _, entry := range entries { - entryPath := path.Join(stylesPath, entry.Name()) + entryPath := filepath.Join(stylesPath, entry.Name()) style, err := readStyleYamlFile(entryPath) if err != nil {