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

cannot find module providing package: working directory is not part of a module #736

Open
ghost opened this issue Jul 16, 2020 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jul 16, 2020

I'm trying to execute the Tutorial 1 code but I run into this error:

$ go run traffic.go
traffic.go:4:2: cannot find module providing package github.com/EngoEngine/ecs: working directory is not part of a module
traffic.go:5:2: cannot find module providing package github.com/EngoEngine/engo: working directory is not part of a module
traffic.go:6:2: cannot find module providing package github.com/EngoEngine/engo/common: working directory is not part of a module

I had to activate modules in order to solve this other error: #724

@otraore otraore self-assigned this Jul 16, 2020
@otraore
Copy link
Member

otraore commented Jul 16, 2020

I added the proper go.mod file in this commit to the TrafficManager repository. Make sure you pull the latest changes and it should work for you. Let me know how it goes.

@Noofbiz
Copy link
Member

Noofbiz commented Jul 16, 2020

We’ll actually have to add that to all the branches as well. I can get around to it this evening when I’m home if it’s still needed ^_^

ETA I’ll also add a bit about go mod in the tutorial, since that’s basically required now :P

@ghost
Copy link
Author

ghost commented Jul 16, 2020

Great, thank you :). One thing though: in the Foreword, you recommend setting GOPATH and running go get -u github.com/EngoEngine/engo inside GOPATH. This should be fine because, even though modules are on by default, the GOPATH/src is excluded from module behavior.

However, due to issue #724, one must force module behavior by setting the environment variable GO111MODULE=on. This variable makes any folder inside GOPATH be module-aware.

Thus, once GO111MODULE is set, you can no longer use go get inside GOPATH (if you do, the packages are just cached), and the only way to download a package would be to use git clone.

So perhaps it would be better to indicate git clone from the beginning of the tutorial, instead of go get? I'm quite new to this, but at least that's how I understood it.

@Noofbiz
Copy link
Member

Noofbiz commented Aug 6, 2020

All branches now have go modules, but I haven't gotten to updating the tutorial yet so I'll leave this open

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