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

go: fix ambiguous import when using a module without a dot #7979

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

vincentbernat
Copy link
Contributor

Due to a bug in Go 1.20 (see golang/go#61873), when importing a module without a dot in it, we get:

 18:13 ❱ GOTOOLCHAIN="go1.20+auto" go get
akvorado: ambiguous import: found package akvorado in multiple modules:
        akvorado (/home/bernat/code/free/akvorado)
         (/home/bernat/src/gocode/pkg/mod/golang.org/toolchain@v0.0.1-go1.20.linux-amd64/src/akvorado)

This issue was fixed in Go 1.20.8 which was just released. By using go1.20.8 as a toolchain for anything <= 1.20, we still cover the use case introduced in #7884, but we also avoid this bug. go1.20.8 is a valid toolchain. For Go 1.20, only go1.20 is a valid version for go directive in go.mod.

Due to a bug in Go 1.20 (see golang/go#61873),
when importing a module without a dot in it, we get:

```
 18:13 ❱ GOTOOLCHAIN="go1.20+auto" go get
akvorado: ambiguous import: found package akvorado in multiple modules:
        akvorado (/home/bernat/code/free/akvorado)
         (/home/bernat/src/gocode/pkg/mod/golang.org/toolchain@v0.0.1-go1.20.linux-amd64/src/akvorado)
```

This issue was fixed in Go 1.20.8 which was just released. By using
`go1.20.8` as a toolchain for anything <= 1.20, we still cover the use
case introduced in dependabot#7884, but we also avoid this bug. `go1.20.8` is a
valid toolchain. For Go 1.20, only `go1.20` is a valid version for `go`
directive in `go.mod`.
@vincentbernat vincentbernat requested a review from a team as a code owner September 6, 2023 16:23
@github-actions github-actions bot added the L: go:modules Golang modules label Sep 6, 2023
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've been waiting for this to drop to fix this issue.

@jakecoffman jakecoffman merged commit 98038d9 into dependabot:main Sep 6, 2023
79 checks passed
@jakecoffman
Copy link
Member

@vincentbernat This is deployed now. Since you can reproduce the problem can you rerun the job and verify that it's fixed? Thanks!

@vincentbernat
Copy link
Contributor Author

It works fine now, thanks! https://github.com/akvorado/akvorado/network/updates/718843474

brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
…t#7979)

Due to a bug in Go 1.20 (see golang/go#61873),
when importing a module without a dot in it, we get:

```
 18:13 ❱ GOTOOLCHAIN="go1.20+auto" go get
akvorado: ambiguous import: found package akvorado in multiple modules:
        akvorado (/home/bernat/code/free/akvorado)
         (/home/bernat/src/gocode/pkg/mod/golang.org/toolchain@v0.0.1-go1.20.linux-amd64/src/akvorado)
```

This issue was fixed in Go 1.20.8 which was just released. By using
`go1.20.8` as a toolchain for anything <= 1.20, we still cover the use
case introduced in dependabot#7884, but we also avoid this bug. `go1.20.8` is a
valid toolchain. For Go 1.20, only `go1.20` is a valid version for `go`
directive in `go.mod`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: go:modules Golang modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants