-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: ExpandEnv not expanding windows environment variables #8469
Comments
Sorry about that, the captcha removed the attachment, trying again. Attachments:
|
To send changes, please use the contribution process described at http://golang.org/doc/contribute . A change of this sort should be discussed on the golang-dev list first. Labels changed: added repo-main, release-none, os-windows. |
If sverre.bakke don't do about this, I'll do. Is it okay? |
Sure @mattn. Are you going to use https://msdn.microsoft.com/en-us/library/windows/desktop/ms724265(v=vs.85).aspx ? Alex |
|
Hmm, |
We can't change the behavior of os.ExpandEnv now.
People are probably already using workarounds like translating %name% to
${name}.
I think we should discuss this problem on golang-dev.
|
Sorry, I forgot all about this one. I just used the code I provided earlier in my own project. I understand that its difficult to change the current behaviour, but I suggest that some version of this is added in Go 2.0 when the time comes. I guess, as discussed, the whole api might need a refresh at some point. For now, anyone that need it can just google and find this discussion with working code to use in their own project. Since most of it is ripped from the Golang standard library anyway, the attached code has the same license as the Go standard library and is in my opinion fully owned by the Golang developer team; crossing my fingers and hoping that some version of this is included in the standard library at some point :) @mattn thanks for pushing this discussion :) |
I think you could use golang.org/x/sys/windows/registry.ExpandString instead. |
by sverre.bakke:
The text was updated successfully, but these errors were encountered: