cactus / go-camo

A secure image proxy server
MIT License
255 stars 48 forks source link

build failed with incorrect import? #29

Closed h8liu closed 6 years ago

h8liu commented 6 years ago
can't load package: package github.com/cactus/go-camo/cmd/go-camo: code in directory /go/src/github.com/cactus/go-camo/cmd/go-camo expects import "github.com/cactus/go-camo"
can't load package: package github.com/cactus/go-camo/cmd/url-tool: code in directory /go/src/github.com/cactus/go-camo/cmd/url-tool expects import "github.com/cactus/go-camo"

I think the directory structure is changed, but not the import path hint.

dropwhile commented 6 years ago

🤔 hmm. I recently switched the master branch to using vgo, which is likely the cause.

What steps did you take to get that error?

h8liu commented 6 years ago

go get -u github.com/cactus/go-camo/cmd/go-camo

h8liu commented 6 years ago

example build log here: https://smallrepo.com/builds/20180802-041631-760e8b5c

h8liu commented 6 years ago

it's okay if you say that "go get" is no longer supported, but the import path does not look right non-the-less. or is that a vgo thingy?

dropwhile commented 6 years ago

Ah... yeah, vgo isn't fully supported in mainline go yet (so go get doesn't work right now). Currently you need to check out the repository to do a build.

If you need to use go get due to environmental requirements, you should still be able to go get the previous release tag using gopkg.in's versioning urls.

go get -u gopkg.in/cactus/go-camo.v1/cmd/go-camo

That should auto-select version v1.1.2 (see: http://labix.org/gopkg.in for more details).
It might be easier to just use the prebuild release binaries though too.

dropwhile commented 6 years ago

And sorry about go get unexpectedly not working anymore. I've had a bit of CI fallout (circle.ci) with the change too. That's what I get for trying to get ahead of the curve with go dependency management for a change! ha!

dropwhile commented 6 years ago

whelp. Looks like I fixed it! 🎉

It seems vgo doesn't require the weird import comment any longer, which was indeed added there just for vgo.

dropwhile commented 6 years ago

Closing as resolved. Work arounds shouldn't be needed. If you still run into issues, then let me know.