-
Notifications
You must be signed in to change notification settings - Fork 72
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
go 1.11 mod support #296
Comments
for me it does not work inside any gomod enabled src directory. Output with modules enabled (GO111MODULE=on and go.mod in the src path):
Output with modules disabled (GO111MODULE=off):
|
Sad workaround:
#!/usr/bin/env bash
set -e
rm -f "gen.go"
for PKG in $(go list -f '{{ join .Imports "\n" }}' | grep '\.'); do
(cd "$HOME/go"; GOPATH="$(pwd)" go get -u "$PKG")
done
GO111MODULE=off kallax gen -e "gen.go" --output "gen.go"
May or may not work with your setup, but you get the idea. Tested with Go 1.12.1 on macOS. The |
Thanks for the workaround. Had basically the same thing in place, but I did not know about the Imports / go get part. Any plans about supporting modules? |
kallax models should be generated with 'make generate-go', kallax migrations should be generated with 'MIGRTION_NAME=<name> make generate-migrations' and packed with 'make pack-migrations' All the code generation: kallax and vendor can be done at once with 'make generate' kallax does not work with go Modules, so it'll be disabled issue: src-d/go-kallax#296 Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
It looks like kallax uses https://github.com/src-d/go-parse-utils for parsing go files. The go-parse-utils library exposes GOPATH as a first class concept |
There has been any progress on this? |
Was so eager to try it out, but faces this problem. Would be awesome if we could support go mod. |
I've been using a variation of @ibrt script: #!/usr/bin/env bash
set -e
export GO111MODULE=off
export GOPATH=/tmp/kallax
FILE=kallax.go
mkdir -p $GOPATH
if [ -f "$FILE" ]; then
mv $FILE $FILE.old
fi
for PKG in $(go list -f '{{ join .Imports "\n" }}' | grep '\.'); do
(cd "$GOPATH"; go get "$PKG")
done
if [ -f "$FILE.old" ]; then
mv $FILE.old $FILE
fi
kallax $@ And it works pretty well and don't pollute my default GOPATH. |
It gives I'm not sure what's wrong, will take a look later today |
Do you have go get -u gopkg.in/src-d/go-kallax.v1/... You may also want to omit the The
|
Signed-off-by: Sergey Kostyaev <feo.me@ya.ru>
Signed-off-by: Sergey Kostyaev <sergey.kostyaev@bitfury.com>
fix src-d#296 - add go modules support
fix src-d#296 - add go modules support
See https://github.com/networkteam/go-kallax for an updated fork (of a fork) that supports Go modules and also makes the tests with Go modules green again. |
@hlubek, it appears that some import references should be fixed
|
Hi @llonchj, maybe the pre-release tag wasn't fetched. For me it worked when I used |
kallax gen
does not work when in a module outside GOPATH.The text was updated successfully, but these errors were encountered: