--
minux <minu...@gmail.com> writes:That means that an experienced user may want it to happen while an
> I think the main reason CL that refuses to "go get" when GOPATH is not
> set is rejected is because it's occasionally useful to able to "go
> get" to GOROOT. (this mechanism is good, and we shouldn't enforce a
> particular policy [go get must install to GOPATH] with the go command)
inexperienced user certainly doesn't.
IMO, adding a flag that declares it OK to fallback to GOROOT or
something might solve that, but at that point I don't see why you
wouldn't just set GOPATH to GOROOT to get that effect.
> I'm willing to do the documentation fixes. What do you suggest?I don't think anyone would read the documentation. If they read the
documentation carefully enough, I don't think I'd have to clean up after
them as much.
Before someone runs her first python script, she doesn't read the
python docs to try to understand PYTHONPATH and make sure it's set up
correctly. Just run it and see what happens. What happens with go by
default is a mess is made which leads to confusion and eventually
enlightenment and cleanup, but it seems that that path is longer than
necessary.
Maybe change "go get" to read up GOPATH and offer a choice of workspace to import to?"$ go get code.google.com/p/go.example/helloChoose workspace to import to:[1] $GOPATH/first[2] $GOPATH/second...$ 2$ installed to $GOPATH/second"
This will also make it obvious that you can create workspaces other than the default one.As far as declaring a GOPATH, this is already covered in the documentation.I've only used Go in Win and GNU/Linux and I never used any installers, I just simply created some conf files for setting the envvars after going through the documentation, the first time and reused them ever since. Maybe be some tools to do that would also help.
Dave
--
So, I agree that advanced users might want it to put it in GOROOT, but I also support the notion that "go get" should fail if GOPATH is unset. What if "go get" only will install in GOROOT if GOPATH is set, but empty?
Or you can just use your dvcs of choice and do the checkout manually.
I cant think of a reason, apart from OS distro packaging, where you would need this function from the go tool. Can we turn the discussion to _why_ this may be needed, not _how_ it could be implemented?
--
I think the main reason CL that refuses to "go get" when GOPATH is not setis rejected is because it's occasionally useful to able to "go get" to GOROOT.
I'm willing to do the documentation fixes. What do you suggest?
Back in the day, before the Go 1.0 release, $GOROOT was mandatory for building from source. Fast forward to now and $GOPATH is mandatory and $GOROOT is optional, ...
I think the main reason CL that refuses to "go get" when GOPATH is not setis rejected is because it's occasionally useful to able to "go get" to GOROOT.Occasionally it would be useful to compile a Go program with unusedimports or unused variables; but it is forbidden because it is dangerous.go get without GOPATH is also dangerous, it should be forbidden.
It seems to me that someone who wants to install to GOROOT can simply runGOPATH=$GOROOT go get thiscoolpackage
To Volker, the only person so far to come up with a possible use for
the _current_ behaviour of go get, I'm sorry, this change would make