makii42 / gottaw

Yet another golang autobuild daemon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go get does not work

makii42 opened this issue · comments

commented

As it seems, go get github..com/makii42/gottaw does not work right now:

# - > docker run --rm -it golang:1.9
root@025ad23d2796:/go# 
root@025ad23d2796:/go# go get github.com/makii42/gottaw
# github.com/makii42/gottaw/docker
src/github.com/makii42/gottaw/docker/docker.go:51:2: cannot use *client.Client as type Client in return argument:
	*client.Client does not implement Client (wrong type for ContainerCreate method)
		have ContainerCreate("github.com/docker/docker/vendor/golang.org/x/net/context".Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, string) (container.ContainerCreateCreatedBody, error)
		want ContainerCreate("context".Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, string) (container.ContainerCreateCreatedBody, error)
root@025ad23d2796:/go#
commented

As it seems, this blows up in our face because docker keeps the vendor folder checked in: vendor/ folder in docker repo. It seems that go get just clones it, the subsequent build together with gottaw declaring an interface for mockability of the docker client, causes the build to fail because of the import path to context of the actual docker client now is "github.com/docker/docker/vendor/golang.org/x/net/context", vs "context" without the vendor/ mess does not work well.

commented

I cannot really fix that. Docker / moby checks in the vendored dependencies. I will look at how to use the larger interface around the docker client that comes with the package instead of using an interface that replicates functions I use of it.

commented

I played around with a few more things, but as long as docker does not remove the content of its' vendor/ folder, there is nothing I can do on my end to make it work with go get.

I will update the README to point ppl towards the pre-built binaries.