-
Notifications
You must be signed in to change notification settings - Fork 605
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
Use 'git clone' instead of 'go get' for the build or developer's … #671
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ automatically set in all console sessions. | |
To get the source code, run | ||
|
||
``` | ||
go get github.com/google/pprof | ||
eval {'mkdir -p',cd}\ $GOPATH/src/github.com/google\; | ||
git clone [email protected]:google/pprof.git | ||
``` | ||
|
||
To run the tests, do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,11 @@ Prerequisites: | |
- Graphviz: http://www.graphviz.org/ | ||
Optional, used to generate graphic visualizations of profiles | ||
|
||
To build and install it, use the `go get` tool. | ||
To build and install it, use `git clone`. | ||
|
||
go get -u github.com/google/pprof | ||
eval {'mkdir -p',cd}\ $GOPATH/src/github.com/google\; | ||
git clone [email protected]:google/pprof.git | ||
go install | ||
|
||
Remember to set GOPATH to the directory where you want pprof to be | ||
installed. The binary will be in `$GOPATH/bin` and the sources under | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"eval" seems scary, as well as creating a directory for people. This will also fail if $GOPATH is not set since this will try to create a directory at the root ("/src/github.com/google").
It also creates impression that the source directory has to be under $GOPATH, but $GOPATH is considered largely deprecated since Go 1.13 (I believe its only intended usage is being able to override where the module cache is stored, but that should be rare / not needed).
So, I think I would instead use
and change
cd $GOPATH/src/github.com/google/pprof
tocd /tmp/pprof
in other commands below. This should make it clear that the checkout directory can be in any location and people who read the instruction will override it with their favorite path (e.g. I use~/src/pprof
).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.
do we want to replace:
"""
Make sure
GOPATH
is set in your current shell. The common way is to havesomething like
export GOPATH=$HOME/gocode
in your.bashrc
file so that it'sautomatically set in all console sessions.
"""
with
"""
Make sure to use a GoLang version 1.13 or above.
"""
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.
Do we want to keep:
"""
When you wish to work with your own fork of the source (which is required to be able to create a pull request), you'll want to get your fork repo as another Git remote in the same
github.com/google/pprof
directory. Otherwise, if you'llgo get
your fork directly, you'll be getting errors likeuse of internal package not allowed
when running tests. To set up the remote do something likewhere
aalexand
is your GitHub user ID. Then proceed to the GitHub UI to send acode review.
"""
We could replace all the above by:
"""
To make changes to the code:
Then proceed to the GitHub UI to send a
code review.
"""
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.
We don't need to say "Make sure to use a GoLang version 1.13 or above" because we already reference https://golang.org/doc/devel/release#policy which as of now means that pprof only supports Go 1.17 and Go 1.16.