-
Notifications
You must be signed in to change notification settings - Fork 13
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
Public export of getExecutableRealPath
and refactoring loading the exe path
#34
Conversation
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.
Just a small change request, looks good otherwise and thanks for the tests.
The ci is failing while downloading It seems that |
Yeah, I am just running the test again. If it doesn't pass, the way it could work is by bumping the minimal version of go to 1.19 (and max to 1.21) along with using |
It actually passed. Well, will do a different PR for upgrading the version. |
Shouldn't the "LoadPath method be private? It doesn't seem to perform any public function. |
I thought of Maybe I could have written the docs to be more clear on it's usage or make Let me know if you need any further clarifications or modifications |
That doesn't seem to explain why it should be public. It runs the code just once and is always executed before any of the getters return. Why expose it at all? |
To give an a different and clear escape hatch if something goes wrong, making all the following calls to the getters "safe", That said, if this is not seen as useful or maybe decremental, I can make |
This is what I am not understanding. What is unsafe about not calling the |
Got the lightbulb moment, that is just redundant at best and confusing at worst. Tell me if you want to fix it, otherwise I'll make a PR later in the day. |
If you are happy to fix this with another PR that would be excellent thanks. |
Export to the public the call to
getExecutableRealPath
since it can be usefull,also added the sibling calls
GetExecutableDefaultOldPath
andGetExecutableNewPath
.The function
LoadPath
issync.Once
to limit performance related issues