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: code.html page assumes GOPATH is not a list #28905

matthewvcarey1 opened this Issue Nov 21, 2018 · 4 comments


None yet
5 participants

matthewvcarey1 commented Nov 21, 2018

What version of Go are you using (go version)?

$ go version
go version go1.4.3 linux/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

go env Output
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"

cat /etc/issue
Welcome to openSUSE Tumbleweed 20181103

What did you do?

Use the documentation page to try and set up and use go
to run initial examples

The documentation assumes that the go env GOPATH returns a single path not a list of paths.

go env GOPATH

This means that passages like this do not work.

To compile and run a simple program, first choose a package path (we'll use > and create a corresponding package directory inside your workspace:

$ mkdir $GOPATH/src/

An obvious workaround in my case is to use sed but it would make the documentation page less readable.

$ mkdir $(echo "$GOPATH" | sed 's/:.*//g')src/

What did you expect to see?

What did you see instead?


This comment has been minimized.


agnivade commented Nov 21, 2018

The documentation explicitly mentions how to set a GOPATH here - and goes forward with that assumption.

Technically, the documentation is correct in that regard.

Maybe we can add another line saying that GOPATH can have multiple values. But given the fact that we are sunsetting GOPATH, I wouldn't worry about adding further corner cases to it.


This comment has been minimized.


bradfitz commented Nov 21, 2018

(People who like this bug also like #18119)

@bradfitz bradfitz changed the title from The introductory documentation page assumes GOPATH is not a list to doc: code.html page assumes GOPATH is not a list Nov 21, 2018

@bradfitz bradfitz added this to the Go1.13 milestone Nov 21, 2018


This comment has been minimized.

forskning commented Nov 27, 2018

This is originally (some later modifications added) of what I wanted a Wiki page to look like.


This comment has been minimized.

forskning commented Nov 28, 2018

R.C. once wrote about something like $GOROOT/ (to match src/runtime/ and maybe others), maybe such (circa 2017) consideration should be revisited, as that content could go in such an .md file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment