You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function homeDir from all paths_{windows | darwin | unix | plan9}.go does exactly the same thing as os.UserHomeDir. I believe it can be moved to a commons.go file to reduce the amount of os specific code and rely more on built-in functionality.
The text was updated successfully, but these errors were encountered:
The xdg.Home field was introduced because historically, the code for os.UserHomeDir has not been the same between Go versions and I wanted to support as many as possible. For example, the code did change between Go 1.15 and Go 1.16. Regarding moving the implementation for homeDir in a common location, maybe. I don't see advantages in doing so at this point.
However, I might drop xdg.Home (and homeDir) completely in the next major version of the library as older Go versions are not widely used anymore. It must be in a major version because I don't do breaking changes in minor version releases.
Thank you for the fast reply @adrg.
I was trying to get rid of dupplicate code by removing all the 4 homeDir function and replace them with only one. I did not know you would remove the xdg.Home in the future. I guess this can be closed then.
Function
homeDir
from allpaths_{windows | darwin | unix | plan9}.go
does exactly the same thing as os.UserHomeDir. I believe it can be moved to acommons.go
file to reduce the amount of os specific code and rely more on built-in functionality.The text was updated successfully, but these errors were encountered: