-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
chore(project): use go version 1.16 #639
Conversation
test/integration/go.mod
Outdated
|
||
replace github.com/prisma/prisma-client-go => ../../ | ||
|
||
require github.com/prisma/prisma-client-go v0.0.0-00010101000000-000000000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this. It ensures using the local version instead of the latest remote version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way just didn't work(Related to golang/go#44529 ?).
Instead, I selected go get
+ @main
:
https://github.com/prisma/prisma-client-go/pull/639/files#diff-4610f5d48e8f2c54a79733a1c01da75dcf5cd5ebd0f5025cd69bda1a5c48002eR12
https://github.com/prisma/prisma-client-go/runs/3935635760#step:3:68
Step 7/17 : RUN go get github.com/prisma/prisma-client-go@main
---> Running in 1b84702995fe
go: downloading github.com/prisma/prisma-client-go v0.11.1-0.20211018171814-8b28b371abd3
go: downloading github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365
go: downloading github.com/takuoki/gocase v1.0.0
go get: added github.com/prisma/prisma-client-go v0.11.1-0.20211018171814-8b28b371abd3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the other thread about go mod tidy, I believe that should solve this as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
|
||
# generate the client in the integration folder | ||
RUN cd test/integration/; go run github.com/prisma/prisma-client-go generate --schema schemax.prisma | ||
RUN go mod tidy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is without go mod tidy
take.
https://github.com/prisma/prisma-client-go/runs/3935412453#step:3:1956
Step 14/21 : RUN cd test/integration/; go build -o /app/main .
---> Running in fd9ddcd9a6af
go: integration/db: package github.com/iancoleman/strcase imported from implicitly required module; to add missing requirements, run:
go get github.com/iancoleman/strcase@v0.0.0-20190422225806-e506e3ef7365
go: integration/db: package github.com/takuoki/gocase imported from implicitly required module; to add missing requirements, run:
go get github.com/takuoki/gocase@v1.0.0
The command '/bin/sh -c cd test/integration/; go build -o /app/main .' returned a non-zero code: 1
Also,
https://golang.org/doc/go1.16#go-command
Build commands like go build and go test no longer modify go.mod and go.sum by default. Instead, they report an error if a module requirement or checksum needs to be added or updated (as if the -mod=readonly flag were used). Module requirements and sums may be adjusted with go mod tidy or go get.
Therefore, we should execute go mod tidy
after generating files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what we should do instead is commit the go.sum file to VCS, and ensure go mod tidy
was run after generating files locally, so that both go mod/sum files are up-to-date. Then we would also not need to run go mod tidy at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I set it up locally, if you want I can push the correct mod/sum file to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I'll try tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I set it up locally, if you want I can push the correct mod/sum file to this branch.
Please push it. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please try pulling/rebasing from this repo's branch test-integration-mod
, I have pushed the diff there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require github.com/prisma/prisma-client-go v0.0.0-00010101000000-000000000000 | ||
require ( | ||
github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 | ||
github.com/joho/godotenv v1.3.0 | ||
github.com/prisma/prisma-client-go v0.0.0-00010101000000-000000000000 | ||
github.com/shopspring/decimal v1.2.0 | ||
github.com/takuoki/gocase v1.0.0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this I got an error.
https://github.com/prisma/prisma-client-go/runs/3958761686#step:3:1046
Step 9/16 : RUN go build -o /app/main .
---> Running in d65bf1e64845
go: integration/db: package github.com/iancoleman/strcase imported from implicitly required module; to add missing requirements, run:
go get github.com/iancoleman/strcase@v0.0.0-20190422225806-e506e3ef7365
go: integration/db: package github.com/joho/godotenv imported from implicitly required module; to add missing requirements, run:
go get github.com/joho/godotenv@v1.3.0
go: integration/db: package github.com/shopspring/decimal imported from implicitly required module; to add missing requirements, run:
go get github.com/shopspring/decimal@v1.2.0
go: integration/db: package github.com/takuoki/gocase imported from implicitly required module; to add missing requirements, run:
go get github.com/takuoki/gocase@v1.0.0
The command '/bin/sh -c go build -o /app/main .' returned a non-zero code: 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is actually correct 👍
I think this project uses Go version 1.16.
https://github.com/prisma/prisma-client-go/blob/8b28b371abd3df86c718fd5c20be09b4d71468fe/go.mod#L3