Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
go get github.com/pingcap/[email protected]
What did you expect to see?
module being imported successfully
What did you see instead?
go get github.com/pingcap/[email protected]: github.com/pingcap/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v3
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
3.0.3
I think the go.mod file in tidb repo should be updated to module github.com/pingcap/tidb/v3 or v4. Came across this when trying to use the parser and the example imports tidb https://github.com/pingcap/parser/issues/43
I also experienced the same error on go get v3.0. One quick workaround is tagging the latest commit in go get, e.g. go get github.com/pingcap/tidb@2c8afe6e1621d4bc2074d17f6c09c17f99fd4d89.
However, it might be more user friendly if we can simply go get github.com/pingcap/tidb to download the latest source code. At the moment, it appears to be downloading v2.0.11, which is two years old.
$ go get github.com/pingcap/tidb
$ cat go.mod
module example.com/m
go 1.13
require github.com/pingcap/tidb v2.0.11+incompatible // indirect
Duplicate with https://github.com/pingcap/tidb/issues/16381
Most helpful comment
I also experienced the same error on
go get v3.0. One quick workaround is tagging the latest commit ingo get, e.g.go get github.com/pingcap/tidb@2c8afe6e1621d4bc2074d17f6c09c17f99fd4d89.However, it might be more user friendly if we can simply
go get github.com/pingcap/tidbto download the latest source code. At the moment, it appears to be downloadingv2.0.11, which is two years old.