tursodatabase / libsql-client-go

Go client API for libSQL
MIT License
190 stars 24 forks source link

Update Go deps #113

Closed mfridman closed 6 months ago

mfridman commented 6 months ago

This PR pulls in changes from https://github.com/libsql/sqlite-antlr4-parser/pull/4, which fixes an import issue.

In another project I work on, pulling github.com/tursodatabase/libsql-client-go as a dependency causes Go to get tripped up (the underlying issue was fixed in https://github.com/libsql/sqlite-antlr4-parser/pull/4):

go: github.com/antlr/antlr4/runtime/Go/antlr/v4@v4.0.0-20240322200237-990fbc2225a9: parsing go.mod:
    module declares its path as: github.com/antlr4-go/antlr/v4
            but was required as: github.com/antlr/antlr4/runtime/Go/antlr/v4
    restoring github.com/antlr/antlr4/runtime/Go/antlr/v4@v4.0.0-20230512164433-5d1fd1a340c9

Ran:

go get -u ./... && go mod tidy
avinassh commented 6 months ago

I think some dependency got messed up? It is breaking go vet in the CI

Error: ../../../go/pkg/mod/github.com/libsql/sqlite-antlr4-parser@v0.0.0-20240323153644-5c63f680a14e/sqliteparserutils/utils.go:57:42: cannot use antlr.NewInterval(currentIntervalStart, previousToken.GetTokenIndex()) (value of type antlr.Interval) as *antlr.Interval value in argument to append
Error: ../../../go/pkg/mod/github.com/libsql/sqlite-antlr4-parser@v0.0.0-20240323153644-5c63f680a14e/sqliteparserutils/utils.go:66:41: cannot use antlr.NewInterval(currentIntervalStart, previousToken.GetTokenIndex()) (value of type antlr.Interval) as *antlr.Interval value in argument to append
Error: ../../../go/pkg/mod/github.com/libsql/sqlite-antlr4-parser@v0.0.0-20240323153644-5c63f680a14e/sqliteparserutils/utils.go:71:57: cannot use stmtInterval (variable of type *antlr.Interval) as antlr.Interval value in argument to tokenStream.GetTextFromInterval
mfridman commented 6 months ago

I think this is coming from https://github.com/libsql/sqlite-antlr4-parser directly,

# github.com/libsql/sqlite-antlr4-parser/sqliteparserutils
sqliteparserutils/utils.go:57:42: cannot use antlr.NewInterval(currentIntervalStart, previousToken.GetTokenIndex()) (value of type antlr.Interval) as *antlr.Interval value in argument to append
sqliteparserutils/utils.go:66:41: cannot use antlr.NewInterval(currentIntervalStart, previousToken.GetTokenIndex()) (value of type antlr.Interval) as *antlr.Interval value in argument to append
sqliteparserutils/utils.go:71:57: cannot use stmtInterval (variable of type *antlr.Interval) as antlr.Interval value in argument to tokenStream.GetTextFromInterval
mfridman commented 6 months ago

Ah, I see the problem I think this should not be a pointer

https://github.com/libsql/sqlite-antlr4-parser/blob/5c63f680a14ef6d0de8e58ffba89b17f4e2b2dc7/sqliteparserutils/utils.go#L20

EDIT: this should fix it, https://github.com/libsql/sqlite-antlr4-parser/pull/5

mfridman commented 6 months ago

@avinassh This should be ready to trigger the CI workflow whenever you get a chance, thank you!