aboutsummaryrefslogtreecommitdiff
path: root/cmd/mobius-hotline-server/main.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2025-06-26 14:01:22 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2025-06-26 14:01:22 -0700
commit55b8e77c409761639e95168c77dc22c13e858b6b (patch)
treebf2be552503c2674654f77adf9f5941c62d20668 /cmd/mobius-hotline-server/main.go
parent5ec29c573bde2417b5d8788966af2577332ce0fc (diff)
Replace filepath.Join with path.Join for Windows compatibility
Replace all instances of filepath.Join with path.Join across the codebase to improve Windows compatibility following the guidance from https://github.com/golang/go/issues/44305. Key changes: - Replaced filepath.Join with path.Join in 14 files - Updated import statements appropriately - Resolved variable shadowing issues where function parameters named 'path' were conflicting with the path package - Maintained filepath imports where needed for OS-specific functions like filepath.Walk, filepath.IsAbs, filepath.Dir, and filepath.Base All tests pass, confirming the changes maintain functionality while improving cross-platform compatibility.
Diffstat (limited to 'cmd/mobius-hotline-server/main.go')
-rw-r--r--cmd/mobius-hotline-server/main.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go
index e230771..afad4d1 100644
--- a/cmd/mobius-hotline-server/main.go
+++ b/cmd/mobius-hotline-server/main.go
@@ -10,7 +10,6 @@ import (
"os"
"os/signal"
"path"
- "path/filepath"
"syscall"
"github.com/jhalter/mobius/hotline"
@@ -108,7 +107,7 @@ func main() {
os.Exit(1)
}
- srv.AccountManager, err = mobius.NewYAMLAccountManager(filepath.Join(*configDir, "Users/"))
+ srv.AccountManager, err = mobius.NewYAMLAccountManager(path.Join(*configDir, "Users/"))
if err != nil {
slogger.Error(fmt.Sprintf("Error loading accounts: %v", err))
os.Exit(1)
@@ -120,7 +119,7 @@ func main() {
os.Exit(1)
}
- bannerPath := filepath.Join(*configDir, config.BannerFile)
+ bannerPath := path.Join(*configDir, config.BannerFile)
srv.Banner, err = os.ReadFile(bannerPath)
if err != nil {
slogger.Error(fmt.Sprintf("Error loading accounts: %v", err))
@@ -146,7 +145,7 @@ func main() {
}
// Let's try to reload the banner
- bannerPath := filepath.Join(*configDir, config.BannerFile)
+ bannerPath := path.Join(*configDir, config.BannerFile)
srv.Banner, err = os.ReadFile(bannerPath)
if err != nil {
slogger.Error(fmt.Sprintf("Error reloading banner: %v", err))