Skip to content
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

cannot find module providing package github.com/pingcap/tidb/types/parser_driver #187

Closed
s7v7nislands opened this issue Jan 21, 2019 · 3 comments

Comments

@s7v7nislands
Copy link

simple test program.

➜  gotest cat main.go
package main // import "tt"

import (
	"fmt"

	"github.com/pingcap/parser"

	_ "github.com/pingcap/tidb/types/parser_driver"
)

func main() {
	sql := "select 1"

	p := parser.New()

	node, err := p.ParseOneStmt(sql, "", "")
	if err != nil {
		fmt.Printf("parse one statement error: %s", sql)
		return
	}

}

go mod init

➜  gotest cat go.mod
module tt

require (
	github.com/golang/protobuf v1.2.0 // indirect
	github.com/pingcap/errors v0.11.0 // indirect
	github.com/pingcap/parser v0.0.0-20190120153311-05caf0a5ea61
	github.com/pingcap/tidb v2.0.11+incompatible // indirect
	github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7 // indirect
	github.com/sirupsen/logrus v1.3.0 // indirect
	golang.org/x/text v0.3.0 // indirect
)

go build

➜  gotest go build
go: finding github.com/pingcap/parser latest
go: finding github.com/pingcap/tidb/types/parser_driver latest
go: finding github.com/pingcap/tidb/types latest
go: finding github.com/pingcap/tidb/util/hack latest
go: finding github.com/pingcap/tidb/util latest
go: finding github.com/pingcap/tipb/go-tipb latest
go: finding github.com/pingcap/tipb latest
go: finding golang.org/x/text/encoding/japanese latest
go: finding golang.org/x/text/encoding/unicode latest
go: finding golang.org/x/text/encoding/traditionalchinese latest
go: finding golang.org/x/text/encoding/korean latest
go: finding golang.org/x/text/encoding latest
go: finding golang.org/x/text/encoding/charmap latest
go: finding golang.org/x/text/encoding/simplifiedchinese latest
go: finding github.com/golang/protobuf/proto latest
main.go:8:2: unknown import path "github.com/pingcap/tidb/types/parser_driver": cannot find module providing package github.com/pingcap/tidb/types/parser_driver

why the go.mod in this repository named go.mod1?

@tiancaiamao
Copy link
Collaborator

Manually change this line in go.mod

github.com/pingcap/tidb v2.0.11+incompatible // indirect

to

github.com/pingcap/tidb v0.0.0-20190108123336-c68ee7318319

Or, you can specify a tidb version via:

GO111MODULE=on go get -u github.com/pingcap/tidb@5f8265a8f9bebc6d61c18d1e7c0aabb493ef2c41

@s7v7nislands

@s7v7nislands
Copy link
Author

It works! Thanks!
Can you explain why should change that?

@tiancaiamao
Copy link
Collaborator

Ref pingcap/tidb#16381

mutalisk999 pushed a commit to CheetahExchange/gitbitex-spot that referenced this issue Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants