Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

remove /usr/share/gocode and ~/.local/gocode from $GOPATH #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

remove /usr/share/gocode and ~/.local/gocode from $GOPATH #156

wants to merge 1 commit into from

Conversation

aerth
Copy link

@aerth aerth commented Apr 19, 2017

This will work with PR #153 to allow users to use go right away

note that $PATH should also include $GOROOT/bin, which is typically

'PATH=$PATH:/usr/local/go/bin'
@KellerFuchs
Copy link
Member

KellerFuchs commented Apr 19, 2017

Hi, and thanks for the pull request :)

Could you describe what are the issues you encounter with go, and what is special about ~/go ?
Also, /usr/share/gocode contains system-wide installs of Go packages for Debian, is it truly necessary to remove it?

@KellerFuchs KellerFuchs self-requested a review April 19, 2017 23:29
@aerth
Copy link
Author

aerth commented Apr 20, 2017

@KellerFuchs , in recent Go versions, GOPATH variable is ~/go by default

$GOPATH should be user writable, and is where all user source live

To give an example,

# get new package using 'git', and install to $GOPATH/bin
go get -v github.com/golang/example/hello

# run the compiled binary
./go/bin/hello

I had to unset GOPATH to go get packages, because i can't write to /usr/share/gocode

Also, /usr/share/gocode doesn't exist

'System-wide install of go packages' doesn't make sense. Things like gocode, godoc, goimports, and other go tools can still be in /usr/share/gocode/bin but just added to $PATH

GOROOT is usually /usr/local/go and contains a full go tree, including source and go tools such as godoc, and the go compiler 'go'

$GOROOT/bin must be placed before /usr/bin because /usr/bin/go is go version go1.3.3 linux/amd64 which is way outdated

@KellerFuchs
Copy link
Member

@aerth As said on IRC, Debian has Go lib packages that do install their sources under /usr/share/gocode. However, it seems we got rid of those, so we can simplify the GOPATH and switch to the new default value.

Regarding $GOROOT/bin vs /usr/bin, the Debian packages for go ship the binaries in /usr/bin, so that's not needed. Again, as said 1.3.3 is the version shipped in Debian Jessie, and there is a PR ongoing to pull 1.7.5 from jessie-backports.

@KellerFuchs
Copy link
Member

KellerFuchs commented Apr 20, 2017

BTW, this is how you can check which versions of a package are in the Debian archive:

% rmadison golang-go
debian:
 golang-go | 2:1.0.2-1.1       | wheezy           | amd64, armel, armhf, i386
 golang-go | 2:1.3.3-1~bpo70+1 | wheezy-backports | amd64, armel, armhf, i386
 golang-go | 2:1.3.3-1         | jessie           | amd64, armel, armhf, i386
 golang-go | 2:1.7~5~bpo8+1    | jessie-backports | amd64, arm64, armel, armhf, i386, ppc64el
 golang-go | 2:1.7~5           | stretch          | amd64, arm64, armel, armhf, i386, ppc64el
 golang-go | 2:1.7~5           | sid              | amd64, arm64, armel, armhf, i386, ppc64el
 golang-go | 2:1.8~1           | experimental     | amd64, arm64, armel, armhf, i386, ppc64el

Copy link
Member

@KellerFuchs KellerFuchs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for merging this after #153.

@KellerFuchs
Copy link
Member

KellerFuchs commented Apr 24, 2017

@aerth Sorry this is kinda stalled right now, as it depends on #153 and I've not been available to deal with some issues related to package deployments. I will be getting to this as soon as I can, though. :)

There is nothing you need to do, just letting you know I didn't forget about this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants