-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
R4R: Fix incorrect $GOBIN
in Install Go
.
#4113
Conversation
Install Go
.$GOBIN
in Install Go
.
Codecov Report
@@ Coverage Diff @@
## develop #4113 +/- ##
===========================================
- Coverage 59.97% 59.96% -0.02%
===========================================
Files 211 211
Lines 15111 15111
===========================================
- Hits 9063 9061 -2
- Misses 5428 5430 +2
Partials 620 620 |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## develop #4113 +/- ##
===========================================
- Coverage 59.97% 59.96% -0.02%
===========================================
Files 211 211
Lines 15111 15111
===========================================
- Hits 9063 9061 -2
- Misses 5428 5430 +2
Partials 620 620 |
Thanks @yangyanqing. Are the invalid changes present on |
1 similar comment
Thanks @yangyanqing. Are the invalid changes present on |
The invalid changes were present on |
@yangyanqing 0.34 has just been merged/released, so this PR is fine as-is. Thanks! |
@@ -9,8 +9,8 @@ Install `go` by following the [official docs](https://golang.org/doc/install). R | |||
```bash | |||
mkdir -p $HOME/go/bin | |||
echo "export GOPATH=$HOME/go" >> ~/.bash_profile | |||
echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile | |||
echo "export PATH=$PATH:$GOBIN" >> ~/.bash_profile | |||
echo "export GOBIN=\$GOPATH/bin" >> ~/.bash_profile |
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.
Why do we need \
prefixes?
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.
In bash shell, variable in ""
would be extended. The first version of cosmos docs was:
echo "export GOPATH=$HOME/go" >> ~/.bash_profile
source ~/.bash_profile
echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile
source ~/.bash_profile
echo "export PATH=$PATH:$GOBIN" >> ~/.bash_profile
source ~/.bash_profile
After source ~/.bash_profile
, variable which was export just now was extended in current shell. So echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile
was extended to echo "export GOBIN=/home/alice/go/bin" >> ~/.bash_profile
. Otherwise it would be extended to echo "export GOBIN=/bin" >> ~/.bash_profile
.
After executing all steps in first version, we got ~/.bash_profile
:
......
export GOPATH=/home/alice/go
export GOBIN=/home/alice/go/bin
export PATH=/usr/bin/:usr/local/bin:......:/home/alice/go/bin
After executing all steps in current version, we got ~/.bash_profile
:
......
export GOPATH=/home/alice/go
export GOBIN=/bin
export PATH=/usr/bin/:usr/local/bin:......:/bin
After executing all steps in PR version, we got ~/.bash_profile
:
......
export GOPATH=/home/alice/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
We also can modify as following because variables in ''
would not be extended.
mkdir -p $HOME/go/bin
echo 'export GOPATH=$HOME/go' >> ~/.bash_profile
echo 'export GOBIN=$GOPATH/bin' >> ~/.bash_profile
echo 'export PATH=$PATH:$GOBIN' >> ~/.bash_profile
source ~/.bash_profile
Choosing prefix \
for keeping pace with other docs.
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.
In all honestly, I prefer the single-quote syntax
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.
I like single-quote too. @alessio
This bug was fixed by #3975, and broken by #4089
docs/
)sdkch add [section] [stanza] [message]
Files changed
in the github PR explorerFor Admin Use: