Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failed with incorrect import? #29

Closed
h8liu opened this issue Aug 2, 2018 · 8 comments
Closed

build failed with incorrect import? #29

h8liu opened this issue Aug 2, 2018 · 8 comments

Comments

@h8liu
Copy link

h8liu commented Aug 2, 2018

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
Copy link
Member

🤔 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
Copy link
Author

h8liu commented Aug 2, 2018

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

@h8liu
Copy link
Author

h8liu commented Aug 2, 2018

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

@h8liu
Copy link
Author

h8liu commented Aug 2, 2018

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
Copy link
Member

dropwhile commented Aug 2, 2018

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants