mirror of
https://github.com/ahmetb/kubectx.git
synced 2026-03-16 10:52:15 +00:00
Adds a new CacheDir() function that respects the XDG_CACHE_HOME environment variable, matching the bash scripts' behavior. kubectx and kubens now prefer XDG_CACHE_HOME when set, falling back to $HOME/.kube otherwise. This aligns the Go implementations with the bash scripts' cache directory logic. Includes comprehensive tests covering all scenarios: - XDG_CACHE_HOME set (returns the XDG value) - XDG_CACHE_HOME unset (falls back to $HOME/.kube) - Neither set (returns empty string)