A few questions regarding the interaction between multiple GOPATHs and
Say I have two GOPATHs: GOPATH=/gp1:/gp2
For all questions below, I will be building or installing a binary location
in /gp2, whose package path is "myprog";
"myprog" will depend on other packages found both in /gp1 and /gp2.
Consider the steps:
(1) In /gp1, install all packages, via e.g. "go install ..."
(2) Modify the source of some package in /gp1
(3) Go to /gp2, and
(3a) Build "myprog" via "go build", or
(3b) Install "myprog" via "go install"
In either case, (3a) or (3b), will the modifications in step (2) be
reflected in the built binary?
If in step (1) we installed only some of the packages in /gp1, but not all
that are needed by "myprog", then:
(i) If we used (3a), true or false: The installed packages in /gp1 will be
used, the others will be built (for the sake of "myprog") but not installed.
(ii) If we used (3b), true or false: The installed packages in /gp1 will be
used, the others will be built but not installed. (Same as above.)
Is it OK, to have packages in /gp1 and /gp2 that share some (but not all)
of their package paths, e.g.
"lib/pkg1" in /gp1, and
"lib/pkg2" in /gp2
And just to confirm:
If within any gopath (/gp1 or /gp2) a package directory is a symbolic link
to an external directory, then
dependency tracking is unpredictable.