Open rew1nter opened 1 year ago
I had to pin the first option in the go.mod (add the line github.com/smacker/go-tree-sitter v0.0.0-20230720070738-0d0a9f78d8f8
in your example). This might be common go knowledge but I hadn't run into it before either.
I get the same error:
github.com/smacker/go-tree-sitter/javascript: ambiguous import: found package github.com/smacker/go-tree-sitter/javascript in multiple modules:
github.com/smacker/go-tree-sitter v0.0.0-20240514083259-c5d1f3f5f99e (/home/ruben/.asdf/installs/golang/1.22.2/packages/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240514083259-c5d1f3f5f99e/javascript)
github.com/smacker/go-tree-sitter/javascript v0.0.1 (/home/ruben/.asdf/installs/golang/1.22.2/packages/pkg/mod/github.com/smacker/go-tree-sitter/javascript@v0.0.1)
The problem is that a module for the javascript parser for version 0.0.1 exists in the proxy service (see here https://pkg.go.dev/github.com/smacker/go-tree-sitter/javascript), so go mod tidy
will see that one too. The source for that module is not there anymore (now it's just a package), but it looks like it was there at some point, and it is still cached in the proxy.
A workaround is just to deactivate the proxy and go directly to the source (github in this case):
$ GOPROXY=direct go mod tidy
go: finding module for package github.com/smacker/go-tree-sitter/javascript
go: finding module for package github.com/smacker/go-tree-sitter
go: found github.com/smacker/go-tree-sitter in github.com/smacker/go-tree-sitter v0.0.0-20240514083259-c5d1f3f5f99e
go: found github.com/smacker/go-tree-sitter/javascript in github.com/smacker/go-tree-sitter v0.0.0-20240514083259-c5d1f3f5f99e
@smacker do you know the way to get that module out of the proxy? It will be there annoying forever...
This is the error Im getting upon running
go mod tidy
: