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! |
| 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.
Why do we need \ prefixes?
There was a problem hiding this comment.
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_profileAfter 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/binAfter 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:......:/binAfter executing all steps in PR version, we got ~/.bash_profile :
......
export GOPATH=/home/alice/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBINWe 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_profileChoosing prefix \ for keeping pace with other docs.
There was a problem hiding this comment.
In all honestly, I prefer the single-quote syntax
This bug was fixed by #3975, and broken by #4089
docs/)sdkch add [section] [stanza] [message]Files changedin the github PR explorerFor Admin Use: