Commit f9dfbc7
committed
Fix Windows cross-platform compatibility for NewSettingsXmlManager
The test was failing on Windows because os.UserHomeDir() doesn't use the HOME
environment variable on Windows like it does on Unix systems. On Windows, it
uses USERPROFILE and other Windows-specific variables.
Changes:
- NewSettingsXmlManager now checks HOME environment variable first
- Falls back to os.UserHomeDir() if HOME is not set
- This ensures consistent behavior across platforms and fixes the Windows test
- All 14 tests continue to pass on Unix systems
- Should now also pass on Windows CI pipeline
This is a common pattern for cross-platform Go applications that need to
support both Unix HOME and Windows USERPROFILE conventions.1 parent d870537 commit f9dfbc7
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
0 commit comments