Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Dec 4, 2025

Since commits 99fac80 and ec919d8 (PR #418) it's clear that getHomeDir is only used on Windows.

Ironically, $HOME is not used on Windows (instead, it's %USERPROFILE%), so the code always falls back to user.Current, which internally uses os.UserHomeDir to fill in HomeDir.

So, it is both simpler and more correct to use os.UserHomeDir directly. Fall back to "/" in case of an error like the previous implementation did.

Since commits 99fac80 and ec919d8 it's clear that getHomeDir is only
used on Windows. Ironically, $HOME is not used on Windows (instead,
it's %USERPROFILE%), so we always fallback to user.Current, which
internally uses os.UserHomeDir to fill in HomeDir.

So, let's just use os.UserHomeDir directly (and fall back to "/" in case
of an error like the previous implementation did).

Signed-off-by: Kir Kolyshkin <[email protected]>
@guelfey guelfey merged commit 20d95a3 into godbus:master Dec 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants