Tidb: Importing specific tag with go 1.13 fails

Created on 10 Sep 2019  路  3Comments  路  Source: pingcap/tidb

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    go get github.com/pingcap/[email protected]

  2. What did you expect to see?
    module being imported successfully

  3. 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

  4. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    3.0.3

typbug

Most helpful comment

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

All 3 comments

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
Was this page helpful?
0 / 5 - 0 ratings