Hi All,
Sorry if this is a very basic question.
Let us say I have a package called mypkg in GOPATH and I am trying to build mytool in the corresponding source directory.
If I have mypkg source code in /home/dharani/gopath/src/mypkg, then build of mytool goes through fine:
bash-4.1$ go build -v
mypkg
_/home/dharani/tool/mytool
But if I remove the source code from /home/dharani/gopath, then build of mytool fails although the package is available in binary form in the corresponding package directory:
bash-4.1$ go build -v
mytool.go:9:2: cannot find package "mypkg" in any of:
/home/dharani/go/src/mypkg (from $GOROOT)
/home/dharani/gopath/src/mypkg (from $GOPATH)
bash-4.1$ ls -l gopath/pkg/linux_amd64/mcell*
-rw-r--r-- 1 dharani mygroup 254574 Jul 15 16:24 gopath/pkg/linux_amd64/mcell.a
I notice the same thing with GO base release as well. It looks like src directory should always be present.
Can someone tell me why it is so? Am I missing something?
Appreciate your help.
Thanks
dharani