From 31c46a3e5db4957b3f061103d4e12d175b2ee145 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Sat, 14 Nov 2020 11:40:26 +0100 Subject: [PATCH] path.Join -> path/filepath.Join --- pkg/cli/cli.go | 9 +++++---- pkg/providers/minecraft/minecraft.go | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 4120fd3..1655fee 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -6,6 +6,7 @@ import ( "log" "os" "path" + "path/filepath" "strconv" "strings" @@ -50,12 +51,12 @@ func getGamesFromProvider(provider string) []games.Game { func processGames(games []games.Game, outputPath string, dryRun bool) { for _, game := range games { - destinationPath := path.Join(helpers.ExpandUser(outputPath), game.Platform) + destinationPath := filepath.Join(helpers.ExpandUser(outputPath), game.Platform) if len(game.Name) > 0 { - destinationPath = path.Join(destinationPath, game.Name) + destinationPath = filepath.Join(destinationPath, game.Name) } else { log.Printf("[IMPORTANT] Game ID %d has no name!", game.ID) - destinationPath = path.Join(destinationPath, strconv.FormatUint(game.ID, 10)) + destinationPath = filepath.Join(destinationPath, strconv.FormatUint(game.ID, 10)) } // Check if folder exists @@ -65,7 +66,7 @@ func processGames(games []games.Game, outputPath string, dryRun bool) { log.Printf("=> Proceesing screenshots for %s %s", game.Name, game.Notes) for _, screenshot := range game.Screenshots { - destinationPath := path.Join(destinationPath, screenshot.GetDestinationName()) + destinationPath := filepath.Join(destinationPath, screenshot.GetDestinationName()) if _, err := os.Stat(destinationPath); !os.IsNotExist(err) { sourceMd5, err := helpers.Md5File(screenshot.Path) diff --git a/pkg/providers/minecraft/minecraft.go b/pkg/providers/minecraft/minecraft.go index 8d26ee9..08284be 100644 --- a/pkg/providers/minecraft/minecraft.go +++ b/pkg/providers/minecraft/minecraft.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "log" "os" - "path" + "path/filepath" "runtime" "strings" @@ -41,9 +41,9 @@ func GetGames() []games.Game { getScreenshotsFromPath(&minecraftFlatpak, "~/.var/app/com.mojang.Minecraft/.minecraft/screenshots") result = append(result, minecraftFlatpak) } else if runtime.GOOS == "windows" { - getScreenshotsFromPath(&minecraftStandalone, path.Join(os.Getenv("APPDATA"), ".minecraft/screenshots")) + getScreenshotsFromPath(&minecraftStandalone, filepath.Join(os.Getenv("APPDATA"), ".minecraft/screenshots")) } else if runtime.GOOS == "darwin" { - getScreenshotsFromPath(&minecraftStandalone, path.Join(helpers.ExpandUser("~/Library/Application Support/minecraft/screenshots"))) + getScreenshotsFromPath(&minecraftStandalone, filepath.Join(helpers.ExpandUser("~/Library/Application Support/minecraft/screenshots"))) } result = append(result, minecraftStandalone)