pganalyze / pg_query_go

Go library to parse and normalize SQL queries using the PostgreSQL query parser
BSD 3-Clause "New" or "Revised" License
663 stars 79 forks source link

package pg_query_go/v2 not found #57

Closed tedyu closed 2 years ago

tedyu commented 2 years ago

I was following instruction:

go get github.com/pganalyze/pg_query_go/v2
go get: module github.com/pganalyze/pg_query_go@upgrade found (v1.0.3), but does not contain package github.com/pganalyze/pg_query_go/v2
go version go1.16.13 linux/amd64
lfittl commented 2 years ago

It appears that Go produces this error when you don't specify the version explicitly.

This works as expected:

go get github.com/pganalyze/pg_query_go/v2@latest
tedyu commented 2 years ago
go get github.com/pganalyze/pg_query_go/v2@latest
go get: package github.com/pganalyze/pg_query_go/v2 is in the main module, so can't request version latest
lfittl commented 2 years ago

@tedyu Weird - I don't really know why that's not working for you. It works fine here on Go 1.17.

tedyu commented 2 years ago
$ go version
go version go1.17.7 linux/amd64
tedyu commented 2 years ago

I think this issue should be reopened.

tedyu commented 2 years ago
12:38 /tmp $ go version
go version go1.18.3 darwin/amd64
12:40 /tmp $ go get github.com/pganalyze/pg_query_go/v2@latest
go: can only use path@version syntax with 'go get' and 'go install' in module-aware mode