Skip to content
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

Merged
merged 2 commits into from
Apr 16, 2019
Merged

R4R: Fix incorrect $GOBIN in Install Go. #4113

merged 2 commits into from
Apr 16, 2019

Conversation

yangyanqing
Copy link
Contributor

@yangyanqing yangyanqing commented Apr 15, 2019

This bug was fixed by #3975, and broken by #4089

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added a relevant changelog entry: sdkch add [section] [stanza] [message]
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@yangyanqing yangyanqing changed the title Fix empty path in Install Go. R4R: Fix incorrect $GOBIN in Install Go. Apr 15, 2019
@codecov
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Merging #4113 into develop will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             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
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Merging #4113 into develop will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             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

@alexanderbez
Copy link
Contributor

Thanks @yangyanqing. Are the invalid changes present on release/v0.34.0 or only on develop? If they're on release/v0.34.0, this PR should be targeted against that branch as we haven't released yet.

1 similar comment
@alexanderbez
Copy link
Contributor

Thanks @yangyanqing. Are the invalid changes present on release/v0.34.0 or only on develop? If they're on release/v0.34.0, this PR should be targeted against that branch as we haven't released yet.

@yangyanqing
Copy link
Contributor Author

The invalid changes were present on release/v0.34.0 too.
Should I create another PR to fix release/v0.34.0 ?
@alexanderbez

@alexanderbez
Copy link
Contributor

@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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

@alessio alessio merged commit c4f53fa into cosmos:develop Apr 16, 2019
@yangyanqing yangyanqing deleted the frank/fix-install-doc branch May 5, 2019 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants