-
Notifications
You must be signed in to change notification settings - Fork 17.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
doc: miscellaneous documentation improvements #30770
Comments
Can you say exactly what documentation you are looking at? Thanks. It should not be necessary to set |
https://golang.org/doc/install You do need the GOPATH setup in order to install packages. Do I need it to write a simple go program? No, but all it serves is frustrating people later on. And not that later since you'll start installing packages pretty quickly. |
GOPATH has a default value of $HOME/go, so you don't need to explicitly set it. I agree that documentation can always be improved, but if you follow the https://golang.org/doc/install page carefully, it says
And once you go to that page, everything is clearly described. Moreover with 1.13, modules mode will be on by default and from there on, GOPATH will just fade into the background. To that effect, #28215 tracks updating that page to reflect how to write Go code using modules.
Also mentioned here - https://golang.org/doc/code.html#GOPATH
The page links to delve's installation page. I don't think duplicating installation instructions in multiple places will be helpful. If the installation instructions are incomplete, I would request you to ask in that repo instead of here. |
So:
1) The installation page does not mention that I HAVE to use ~/go as my
source code directory and therefore starts the problems. I write in
multiple languages and have a ~/source folder that I then put each language
in. So my default path is not ~/go but rather ~/source/go. This throws
everything off.
2) If you are not going to have a page dedicated to using delve then why do
you have a page dedicated to using gdb which it states doesn't even work?
Seems odd at best.
I was only offering suggestions to aid people in installing and using go
but you obviously feel what you have is perfect and only I am the problem.
So keep what you have as I've already figured it all out and moved on.
glenn
…On Wed, Mar 13, 2019 at 4:48 AM Agniva De Sarker ***@***.***> wrote:
You do need the GOPATH setup in order to install packages.
GOPATH has a default value of $HOME/go, so you don't need to explicitly
set it. I agree that documentation can always be improved, but if you
follow the https://golang.org/doc/install page carefully, it says
Before rushing off to write Go code please read the How to Write Go Code
document, which describes some essential concepts about using the Go tools.
And once you go to that page <https://golang.org/doc/code.html>,
everything is clearly described. Moreover with 1.13, modules mode will be
on by default and from there on, GOPATH will just fade into the background.
To that effect, #28215 <#28215> tracks
updating that page to reflect how to write Go code using modules.
PATH shows adding export PATH=$PATH:/usr/local/go/bin to your .profile but
it should also mention adding export PATH=$PATH:~/go/bin because you can't
debug without it.
Also mentioned here - https://golang.org/doc/code.html#GOPATH
Can't you at least supply basic information about using and installing
delve if that is the only way to really do debugging?
The page links to delve's installation page. I don't think duplicating
installation instructions in multiple places will be helpful. If the
installation instructions are incomplete, I would request you to ask in
that repo instead of here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#30770 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABnkPehvHzGkM5bDKifCId6qSTTdynbMks5vWLtNgaJpZM4bqzyJ>
.
--
--glenn hancock
You can't win an argument with an ignorant person. They'll just drag you
down to their level and beat you with experience.
|
For what it's worth, something about the defaulting of GOPATH seems broken: $ echo $HOME
/home/azarchs
$ (GOPATH="" GO111MODULE=on go env)
missing $GOPATH
$ go version
go version go1.12.1 linux/amd64 |
@adam-azarchs - I am unable to reproduce your issue. If it still happens for you, please open a new issue. paging @bcmills if something concrete can be done on this. |
Interesting... I can only seem to reproduce that on Windows's Linux Subsystem (Ubuntu running under a syscall translation layer, plus some filesystem emulation stuff). So feel free to ignore it, although I'm curious enough as to what about the environment is different enough from real linux to cause this behavior change. |
In order to use go and be able to debug it, there are a few things that need to be done in order for it to work. I suggest you update the docs for installation because there are missing elements that make using it frustrating because it took me a few hours of googling before I figured out what was going on.
GOPATH=~/go/ should be mentioned in your installation instructions as it is needed for a number of things for the environment to function.
PATH shows adding export PATH=$PATH:/usr/local/go/bin to your .profile but it should also mention adding export PATH=$PATH:~/go/bin because you can't debug without it.
You should mention on linux you need to install sudo apt install build-essential in order to debug go.
You have a page on debugging go with gdb but you mention not to use it but to use delve instead. But you don't have a page that I could find on installing and using delve either. The problem here is that the delve documentation is also incomplete and had me chasing two different things. Can't you at least supply basic information about using and installing delve if that is the only way to really do debugging?
Thanks,
The text was updated successfully, but these errors were encountered: