英文:
Why GOPATH turned to "OPATH in go env
问题
你好!以下是你要翻译的内容:
localhost:~ jjw$ cat .bash_profile
export GOPATH="/Users/jjw/gocode"
localhost:~ jjw$
localhost:~ jjw$ source .bash_profile
localhost:~ jjw$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
"OPATH="/Users/jjw/gocode
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused- arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
我对于为什么GOPATH变成了"OPATH"感到困惑。
英文:
localhost:~ jjw$ cat .bash_profile
export GOPATH="/Users/jjw/gocode"
localhost:~ jjw$
localhost:~ jjw$ source .bash_profile
localhost:~ jjw$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
"OPATH="/Users/jjw/gocode
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused- arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
I am confused as to why GOPATH turned to "OPATH.
答案1
得分: 3
我猜你的导出GOPATH行以\r\n(Windows风格)而不是\n(Unix风格)结尾。
\r是回车字符,它只是重置列号。这就是为什么“字符显示在G字符的顶部。
你可以通过在.bash_profile文件上使用od或hexdump命令来检查这一点。
英文:
I suppose your export GOPATH line terminates by \r\n (a la Windows) instead of just \n (a la Unix).
The \r is the carriage return character. It just resets the column number. So that's why the " character is displayed on top of the G character.
You can check this point by using the od or hexdump command on your .bash_profile file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论