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

mage doesn't look in vendor #244

Closed
edgarm1964 opened this issue Jun 4, 2019 · 2 comments
Closed

mage doesn't look in vendor #244

edgarm1964 opened this issue Jun 4, 2019 · 2 comments

Comments

@edgarm1964
Copy link

edgarm1964 commented Jun 4, 2019

Hi,

I'm forced to use mage (I'm building an elastic search beat and I'm running "make ci") and mage doesn't look in the vendor directory (only in src):

execbeat$ GOPATH=${PWD} mage
magefile.go:10:2: cannot find package "github.com/magefile/mage/mg" in any of:
        /Users/edgarm/tools/go/src/github.com/magefile/mage/mg (from $GOROOT)
        /Users/edgarm/Projects/github.com/edgarm1964/execbeat/src/github.com/magefile/mage/mg (from $GOPATH)
Error: error compiling magefiles

The question is why?

General complaint: Why is golang enforcing a build/src structure? ${GOPATH}/src? Golang is a toy.

@natefinch
Copy link
Member

You shouldn't be setting GOPATH to your current working directory. If you're using GOPATH, you need your code to live at $GOPATH/src/github.com/edgarm1964/execbeat .
If you haven't explicitly set GOPATH, it will be interpreted as /Users/edgarm/go

It looks like beats uses glide for vendoring, which means your code still needs to live in GOPATH. (this will be fixed when/if beats moves to using go modules, which can live anywhere you want, like your Projects directory).

@edgarm1964
Copy link
Author

OK, good to know. Thanks.

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

No branches or pull requests

2 participants