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

Init not works on Windows (eternal loop) #786

Closed
dissipative opened this issue Jul 9, 2019 · 0 comments · Fixed by #822
Closed

Init not works on Windows (eternal loop) #786

dissipative opened this issue Jul 9, 2019 · 0 comments · Fixed by #822

Comments

@dissipative
Copy link

dissipative commented Jul 9, 2019

What happened?

go run scripts/gqlgen.go init
lasts forever

What did you expect?

Behavior as described here: https://gqlgen.com/getting-started-dep/

Minimal graphql.schema and models to reproduce

Schema and models are not used, just gqlgen.go script as in instructions

versions

gqlgen version = 0.9.1
go version = go1.12.4 windows/amd64
GOPATH = C:\Users\Username\Develop\go

Actually, the problem is in ImportPathForDir function in internal/code/imports.go path.
There is an infinite loop at 64 line: firstly it checks for the go.mod file, then it tries to find absolute package path and just doing comparison to "/".
I have not tried it in Unix-like systems, but in Windows 10 with dep (and without go mod) installation the loop will never stop because after several cycles variable modDir is became equal to "C:\".
Reference to the problem:

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