-
Notifications
You must be signed in to change notification settings - Fork 121
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
Make schemagen generate compilable code and add test for it #278
Make schemagen generate compilable code and add test for it #278
Conversation
f4a55d4
to
2f653fe
Compare
@@ -30,7 +30,7 @@ func TestSchemagen(t *testing.T) { | |||
|
|||
b := runSchemagen(t, "foobar") | |||
|
|||
const goldenFile = "testdata/models.go.txt" |
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.
What's the reason for a file name change?
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.
It has changed since I want to test generated code for real
cmd/schemagen/schemagen.go
Outdated
if c.Type == "duration" && !existsInSlice(imports, "github.com/gocql/gocql") { | ||
imports = append(imports, "github.com/gocql/gocql") |
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 adding v2
to gocql? I thought we add v2
to gocqlx
not gocql
.
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.
Fixed, thanks.
4cbd1cd
to
5396809
Compare
5396809
to
7b1907f
Compare
It turns out that
schemagen
does not generate compilable file after switching fromv1
tov2
Make it compilable and have a test for it