-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gorename: not properly working on windows using cmd or powershell. #20422
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
Comments
/cc @alandonovan |
As far as I can see this is an issue of how to use the Windows shell. I don't think there is anything that gorename can do to fix this. |
@ianlancetaylor what do you mean "how to use the Windows shell."? BTW I don't know who to blame the Edit: |
Before gorename even gets to see the string you pass to it on the command line, the cmd.exe converts your string into different string using these https://msdn.microsoft.com/en-us/library/17w5ykft.aspx rules. That is just how cmd.exe (the command prompt) works. It is your job to understand these rules and use them accordingly to make sure gorename will get result you want. bash has similar problem, but everyone knows bash rules and adjust things as required. Alex |
@alexbrainman In hindsight, denoting package paths using Go import syntax with quotation marks was a mistake I'll not make again. |
Hindsight is a wonderful thing. If you think https://msdn.microsoft.com/en-us/library/17w5ykft.aspx is complicated, you should check (I do not expect you to) http://daviddeley.com/autohotkey/parameters/parameters.htm#WIN for the complete story. Alex |
Belated thanks for those doc links, which are solid gold. |
closing as obsoleted by #69360 |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.1 windows/amd64
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=F:\GO
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\User\AppData\Local\Temp\go-build311479175=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
Rename a func using gorename on windows command prompt or powershell.
please see this thread also: https://forum.golangbridge.org/t/solved-proper-way-of-using-gorename/5418
What did you expect to see?
gorename should rename the function name.
What did you see instead?
gorename give me an
invalid expression
errorP.S.
Using bash on windows solved the problem, this issue could be just a enhancement request for gorename on MS windows.
Thanks.
The text was updated successfully, but these errors were encountered: