Skip to content

Commit

Permalink
internal: remove redundant check for AppData directory on windows
Browse files Browse the repository at this point in the history
os.UserConfigDir will already check the AppData environment variable on
Windows (environment variable names are case-insensitive on Windows):
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=461-465
  • Loading branch information
tklauser committed Jan 27, 2023
1 parent b4db245 commit 32a3a07
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"os"
"os/user"
"path/filepath"
"runtime"
"strconv"
"strings"
)
Expand All @@ -26,10 +25,6 @@ func ConfigDir() (string, error) {
return filepath.Join(userConfigDir, "gops"), nil
}

if runtime.GOOS == "windows" {
return filepath.Join(os.Getenv("APPDATA"), "gops"), nil
}

if xdgConfigDir := os.Getenv("XDG_CONFIG_HOME"); xdgConfigDir != "" {
return filepath.Join(xdgConfigDir, "gops"), nil
}
Expand Down

0 comments on commit 32a3a07

Please sign in to comment.