On Thu, Feb 29, 2024 at 9:12 AM kredop...@gmail.com <kredopieka...@gmail.com>
wrote:

> Apologies - sent the response only to you, so I'll write it again here.
>
> > Doesn't the `go install` command explicitly instruct you to add
> $GOBIN/$GOPATH/bin to your $PATH?
>
> I did check both golang installation docs and the output of `go help
> install` - it's very possible I'm missing something, but I didn't find any
> mention of adding $GOBIN/$GOPATH to the $PATH. Am I just looking in the
> wrong place?
>

No, I misremembered. I mixed it up with make.bash (the script used to build
Go itself).
Perhaps it would be useful if `go install` would check if $GOBIN is in your
$PATH and print a warning, if not? It's already somewhat verbose (it prints
any dependencies it needs to download), so I feel that the usual "it should
be silent on success" logic doesn't apply and there would be little harm.


>
> > To me, that seems enough - it feels a bit arduous, to expect this piece
> of information at any single point on the web where `go install` is
> mentioned.
>
> I wholeheartedly agree - as long as the information mentioned above is
> visible somewhere else, possibly in at least one of the two places I've
> just listed. I was simply surprised that, possibly due to unskillful
> searches of mine, I didn't find official sources suggesting adding
> $GOBIN/$GOPATH to the $PATH, which may be confusing, especially when
> package docs assume this has been done.
>
> Also, thanks for the quick reply!
>
> On Thursday 29 February 2024 at 06:18:07 UTC+1 Axel Wagner wrote:
>
>> Doesn't the `go install` command explicitly instruct you to add
>> $GOBIN/$GOPATH/bin to your $PATH? To me, that seems enough - it feels a bit
>> arduous, to expect this piece of information at any single point on the web
>> where `go install` is mentioned.
>>
>> On Thu, Feb 29, 2024 at 1:39 AM Robert Sawicki <kredop...@gmail.com>
>> wrote:
>>
>>> Hey!
>>>
>>> As I was looking through Go docs recently, I've noticed docs for
>>> x/pkgsite wrongly assume that user's $PATH includes $GOPATH/bin, by using
>>> `pkgsite` as a way to launch the command right after installing it.
>>>
>>> Golang installation docs <https://go.dev/doc/install>only mention
>>> adding */usr/local/bin/go* to $PATH, so I believe this may be confusing
>>> for new users. At least it was to me.
>>>
>>> Shouldn't these docs explicitly state that they assume that path is
>>> added to $PATH, just for clarity's sake? Or maybe adding $GOPATH/bin (or
>>> $GOBIN) to user's $PATH is a worthy addition to installation docs?
>>>
>>> I decided to ask here, since I don't want to create a whole Github issue
>>> just for something like that. If this gains traction, I'm willing to create
>>> such an issue.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/53386532-7bd4-421a-9f41-b973dbfa68ean%40googlegroups.com
>>> <https://groups.google.com/d/msgid/golang-nuts/53386532-7bd4-421a-9f41-b973dbfa68ean%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/dbc07b3d-4d62-4041-868f-090040322c39n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/dbc07b3d-4d62-4041-868f-090040322c39n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfF2ekq9bxmond00%2B_USccc%2Bew%2BTN%3DvWEyb8XPcpKWny3A%40mail.gmail.com.

Reply via email to