Why don't you enumerate your project directories in the GOPATH variable?
GOPATH=/path/to/proj1:/path/to/proj2:...
Or, alternately, why not cohabit packages inside a single GOPATH's src
directory?
Andrew
I was about to say "just put . in GOPATH as for e.g. PYTHONPATH" but:
2012/01/24 09:23:56 invalid GOPATH ".": must be absolute
package could not be found locally
I suppose this is considered harmful to have '.' being automatically
expanded by go/build ?
-s
this doesn't work when the projects are branches of each other and
so have no natural precedence.
> Or, alternately, why not cohabit packages inside a single GOPATH's src
> directory?
this is also awkward if you have several branched versions of the
same project, as the import paths within each version must match
the directory it's held in.
i am managing to work around this (by working on only one branch at
a time) but it's awkward.
How many projects do you have? Can't you put each of them on your
GOPATH?
Chris
--
Chris "allusive" Dollin
i don't think this'll work.
you don't want GOPATH to point to the current directory,
but the "go root" of the current directory.
one heuristic could be to find the closest enclosing
"src" directory that is alongside a "pkg" directory.
that would probably work in most circumstances.
Ideally the community creates conventions that allow most go projects
to be a simple matter of:
* checkout source
* cd directory
* go install
I also shell scripted my way around things, but it just felt a little
weird and there are still a few things I'm not clear about (dependency
resolution).
--
Edward Muller
@freeformz
If you really really really want to use the current
directory as GOPATH, and you are using Linux,
you can export GOPATH=/proc/self/cwd. However,
I take no responsibility for the breakage you will
encounter.
Russ