-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal improvements #16
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
==========================================
+ Coverage 92.63% 92.78% +0.15%
==========================================
Files 6 8 +2
Lines 190 194 +4
==========================================
+ Hits 176 180 +4
Misses 13 13
Partials 1 1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested 4e50b36 with the previously posted code and it seems to be working now.
xdg.RuntimeFile
gives me a path to use within %LOCALAPPDATA%
, and later finds the socket that is created within it.
The tests also seem to be passing:
> go test -v
=== RUN TestDefaultBaseDirs
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DATA_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_DATA_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming C:\Users\Dominic Della Valle\ProgramData]
xdg_test.go:41: XDG_CONFIG_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_CONFIG_DIRS: [C:\Users\Dominic Della Valle\ProgramData]
xdg_test.go:41: XDG_CACHE_HOME: C:\Users\Dominic Della Valle\AppData\Local\cache
xdg_test.go:41: XDG_RUNTIME_DIR: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_STATE_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_APPLICATION_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming\Microsoft\Windows\Start Menu\Programs]
xdg_test.go:41: XDG_FONT_DIRS: [C:\Windows\Fonts C:\Users\Dominic Della Valle\AppData\Local\Microsoft\Windows\Fonts]
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DATA_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_DATA_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming C:\Users\Dominic Della Valle\ProgramData]
xdg_test.go:41: XDG_CONFIG_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_CONFIG_DIRS: [C:\Users\Dominic Della Valle\ProgramData]
xdg_test.go:41: XDG_CACHE_HOME: C:\Users\Dominic Della Valle\AppData\Local\cache
xdg_test.go:41: XDG_RUNTIME_DIR: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_STATE_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_APPLICATION_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming\Microsoft\Windows\Start Menu\Programs]
xdg_test.go:41: XDG_FONT_DIRS: [C:\Windows\Fonts C:\Users\Dominic Della Valle\AppData\Local\Microsoft\Windows\Fonts]
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DATA_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_DATA_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming C:\Users\Dominic Della Valle]
xdg_test.go:41: XDG_CONFIG_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_CONFIG_DIRS: [C:\Users\Dominic Della Valle]
xdg_test.go:41: XDG_CACHE_HOME: C:\Users\Dominic Della Valle\AppData\Local\cache
xdg_test.go:41: XDG_RUNTIME_DIR: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_STATE_HOME: C:\Users\Dominic Della Valle\AppData\Local
xdg_test.go:41: XDG_APPLICATION_DIRS: [C:\Users\Dominic Della Valle\AppData\Roaming\Microsoft\Windows\Start Menu\Programs]
xdg_test.go:41: XDG_FONT_DIRS: [C:\Users\Dominic Della Valle\Fonts C:\Users\Dominic Della Valle\AppData\Local\Microsoft\Windows\Fonts]
--- PASS: TestDefaultBaseDirs (0.00s)
=== RUN TestCustomBaseDirs
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DATA_HOME: C:\Users\Dominic Della Valle\Appdata\Local\Data
xdg_test.go:41: XDG_DATA_DIRS: [C:\Users\Dominic Della Valle\Appdata\Local\Data C:\Users\Dominic Della Valle\Appdata\Data]
xdg_test.go:41: XDG_CONFIG_HOME: C:\Users\Dominic Della Valle\Appdata\Local\Config
xdg_test.go:41: XDG_CONFIG_DIRS: [C:\Users\Dominic Della Valle\Appdata\Local\Config C:\Users\Dominic Della Valle\Appdata\Config]
xdg_test.go:41: XDG_CACHE_HOME: C:\Users\Dominic Della Valle\ProgramData\Cache
xdg_test.go:41: XDG_RUNTIME_DIR: C:\Users\Dominic Della Valle\ProgramData\Runtime
xdg_test.go:41: XDG_STATE_HOME: C:\Users\Dominic Della Valle\ProgramData\State
--- PASS: TestCustomBaseDirs (0.00s)
=== RUN TestDefaultUserDirs
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DESKTOP_DIR: C:\Users\Dominic Della Valle\Desktop
xdg_test.go:41: XDG_DOWNLOAD_DIR: C:\Users\Dominic Della Valle\Downloads
xdg_test.go:41: XDG_DOCUMENTS_DIR: C:\Users\Dominic Della Valle\Documents
xdg_test.go:41: XDG_MUSIC_DIR: C:\Users\Dominic Della Valle\Music
xdg_test.go:41: XDG_PICTURES_DIR: C:\Users\Dominic Della Valle\Pictures
xdg_test.go:41: XDG_VIDEOS_DIR: C:\Users\Dominic Della Valle\Videos
xdg_test.go:41: XDG_TEMPLATES_DIR: C:\Users\Dominic Della Valle\Templates
xdg_test.go:41: XDG_PUBLICSHARE_DIR: C:\Users\Dominic Della Valle\Public
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DESKTOP_DIR: C:\Users\Dominic Della Valle\Desktop
xdg_test.go:41: XDG_DOWNLOAD_DIR: C:\Users\Dominic Della Valle\Downloads
xdg_test.go:41: XDG_DOCUMENTS_DIR: C:\Users\Dominic Della Valle\Documents
xdg_test.go:41: XDG_MUSIC_DIR: C:\Users\Dominic Della Valle\Music
xdg_test.go:41: XDG_PICTURES_DIR: C:\Users\Dominic Della Valle\Pictures
xdg_test.go:41: XDG_VIDEOS_DIR: C:\Users\Dominic Della Valle\Videos
xdg_test.go:41: XDG_TEMPLATES_DIR: C:\Users\Dominic Della Valle\Templates
xdg_test.go:41: XDG_PUBLICSHARE_DIR: C:\Users\Dominic Della Valle\Public
--- PASS: TestDefaultUserDirs (0.00s)
=== RUN TestCustomUserDirs
xdg_test.go:22: Home: C:\Users\Dominic Della Valle
xdg_test.go:41: XDG_DESKTOP_DIR: C:\Users\Dominic Della Valle\Files\Desktop
xdg_test.go:41: XDG_DOWNLOAD_DIR: C:\Users\Dominic Della Valle\Files\Downloads
xdg_test.go:41: XDG_DOCUMENTS_DIR: C:\Users\Dominic Della Valle\Files\Documents
xdg_test.go:41: XDG_MUSIC_DIR: C:\Users\Dominic Della Valle\Files\Music
xdg_test.go:41: XDG_PICTURES_DIR: C:\Users\Dominic Della Valle\Files\Pictures
xdg_test.go:41: XDG_VIDEOS_DIR: C:\Users\Dominic Della Valle\Files\Videos
xdg_test.go:41: XDG_TEMPLATES_DIR: C:\Users\Dominic Della Valle\Files\Templates
xdg_test.go:41: XDG_PUBLICSHARE_DIR: C:\Users\Dominic Della Valle\Files\Public
--- PASS: TestCustomUserDirs (0.00s)
=== RUN TestBaseDirFuncs
--- PASS: TestBaseDirFuncs (0.02s)
PASS
ok github.com/adrg/xdg 0.060s
@djdv Thank you for all the help. I'll release a new version shortly so you can use it in your project. |
Thanks for the support! Happy to help :^) |
os.Stat
bugs on Windows, described by issues:js/wasm
On some versions of Windows,
os.Stat
returns an error for Unix sockets. Also, seems like on all Windows versions, it returns an error for symbolic links to directories.