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

README: simplify installation instructions #9

Merged
merged 3 commits into from Nov 5, 2018

Conversation

Projects
None yet
2 participants
@dmitshur
Member

dmitshur commented Nov 4, 2018

go get already does the work done by go install ¹, so doing a go install
afterwards is redundant. Use this property to make the installation
process simpler.

¹ https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies

This assumes a GOPATH workspace mode, but the current directions seem to imply that (i.e., $GOPATH/bin is mentioned in the comment).

You may want to include -u flag by default, if you'd rather have the go get command produce more predictable results. Without -u, if the user happens to have really old versions of some dependencies (rather not have them at all), go get will not update them and your program may not build. If the user doesn't have those dependencies, go get will fetch the latest version. Using the -u flag makes go get -u always get the latest version, which is more consistent and predictable.

README: simplify installation instructions
go get already does the work done by go install ¹, so doing a go install
afterwards is redundant. Use this property to make the installation
process simpler.

Also remove an unneeded blank line.

¹ https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies
@alandonovan

Thanks for pointing out the oversight. I used separate get/install commands because I intended to use get -u, but forgot to add it. I'll make a separate change to add it; you can revert this one.

It's funny how many mistakes it's possible to make in a very few lines of boilerplate-y documentation. I have a renewed appreciation for your tool for automating the creation of project pages from source code.

@dmitshur

This comment has been minimized.

Member

dmitshur commented Nov 5, 2018

The change to add -u flag is great, and has my full support.

However, I want to clarify, go get -u does the go install step even if -u flag is used, so go install is still redundant (it doesn't do anything extra that go get -u wouldn't have already done).

I'll rebase this PR on top 1adc2a6 so you can reconsider it.

The final formatting is up to you; I'm happy to adjust it to fit your preference. The purpose of this PR is to suggest removing the redundant go install command.

dmitshur added some commits Nov 5, 2018

README: adjust go get -u comment formatting
This way, it fits on the page without having to scroll.

I'm happy to change it if requested.
@alandonovan

This comment has been minimized.

Collaborator

alandonovan commented Nov 5, 2018

Aha, so it does. I seem to have a mental block whereby I can never hold in my head for more than 5 minutes the behavior of get, get -u, and install as they apply to main and importable packages. This change looks good. Thanks for persevering in your explanation!

@alandonovan alandonovan merged commit 5e133cf into google:master Nov 5, 2018

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dmitshur dmitshur deleted the dmitshur:patch-2 branch Nov 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment