I'm still trying to get my head around the Go workspace layout. I have a package, todinfo
and a sample program which uses it, untod
.
I currently have this arrangement of directories:
$GOPATH
+- bin...
+- pkg ...
+- src
+- github.com
+- longborough
+- (others)...
+- todinfo
+- todinfo.go
+- untod.go
I originally developed these two programs in separate directories. However, since untod
is really part of the todinfo package, it seems more sensible to package it up as a single project, in the same directory.
But when I try to install (I've wrapped the reply onto three lines for clarity):
D:\Development\Go\src\github.com\longborough\todinfo>go install
can''t load package: package github.com/longborough/todinfo:
found packages todinfo (todinfo.go) and main (untod.go)
in D:\Development\Go\src\github.com\longborough\todinfo
I hope I'm mistaken, but this smells a bit like Java, at least to the uninitiated.
What am I doing wrong? What Go commands should I use to install the package and then install the sample? Or, what is the correct directory arrangement?