Closed saljam closed 8 years ago
I propose we do that by moving the go files in the root directory into a directory of their own called "xhyve" (to match the package name) and moving bin/main.go to the root. (Or to cmd/docker-machine-driver-xhyve similar to how golang.org/x/tools does it for example.)
What do you think? Would this break the build in any way I've not anticipated?
@saljam Thanks issue!
I was inspired by your comments(It's not that the folder structure), I have testing it now. I will reply later.
@saljam I think so, too.
The reason is that the first docker-machine
driver sample repository was that folder structure.
As you have proposed, I think,
zchee/docker-machine-driver-xhyve/bin/main.go
to zchee/docker-machine-driver-xhyve/main.go
zchee/docker-machine-driver-xhyve/*.go
to zchee/docker-machine-driver-xhyve/xhyve
main.go
import pkg to zchee/docker-machine-driver-xhyve/xhyve
However, in a typical docker-machine driver will be complete in it, but docker-machine-driver-xhyve
binary need owner to root:wheel
, and set root uid (-rwsr-xr-x root:wheel
) hack.
The caused by vmnet.framework
required sudo
.
See https://github.com/zchee/docker-machine-driver-xhyve/blob/master/Makefile#L119
So, Folder structure will be clean, but can not full installation only go get
for now.
Thanks! And yes, of course, it will still need to be run as root.
Building with the makefile might be useful for development, but you don't always need one for Go and being able to install the driver binary by just running:
makes it easier to get started and is more idiomatic Go.