developer-portal / content

Content for the Fedora Developer Portal
https://developer.fedoraproject.org/
GNU General Public License v2.0
107 stars 249 forks source link

Added explanation for Fedora GOROOT #470

Closed jboero closed 1 year ago

jboero commented 1 year ago

I found this part problematic and not matching other distributions.

jboero commented 1 year ago

@cuviper or @voxik not sure who to assign this to but a simple docs addition for Go developers as I just wasted a few hours setting up a fresh GOROOT in latest F37. Thanks!

jackorp commented 1 year ago

Sorry, I had to delete a few comments of mine, they were duplicated. GitHub saved already-made comments when I tabbed out but I did not notice it and thought they are gone...

jboero commented 1 year ago

Thanks for the feedback. I see things seem to have changed for me since last time I set up a fresh Go env. I had an explicit GOROOT env variable set. Removing that the platform correctly defaults to /usr/lib/golang.

Yes golang-src should be installed as a dependency but it's not clear that that's the package that includes a Fedora-signed GOROOT in path /usr/lib/golang. All of GoLang's public documentation is Ubuntu-oriented or at least avoids packaging saying to just expand an archive into /usr/local/go. I see conflicting threads in old and new Go docs and forums that say whether a GOROOT or GOPATH must be set a certain way. The latest Fedora defaults seem fine so long as you have root access to install the standard packaging rather than download a goroot archive.

https://go.dev/doc/install

Up to you if you think this helps now. I see it's not really necessary.

jackorp commented 1 year ago

Glad to hear it works OK from the default Fedora package. If it'd been otherwise, I'd consider it a Fedora bug :).

BTW it seems that with the Fedora package, it is possible to have different versions available. You can follow this upstream guide: https://go.dev/doc/manage-install

Since you no longer see these changes as necessary, I'll close this PR.